modelFunctions {asreml}R Documentation

Model term constructor functions.

Description

This class of special functions constructs model terms with specific properties.

Usage

con(obj)

lin(obj)

pow(obj, p=1, offset=0)

pol(obj, t=1, init=NA)

leg(obj,t=1,init=NA)

spl(obj, k=0, init=NA)

dev(obj, init=NA)

ma(obj)

at(obj,lvls)

and(obj, times=1)

mbf(obj)

grp(obj)

dsum(model, levels=NULL, outer=FALSE)

C(obj, contr)

Arguments

obj

An object in the data frame.

mbf

A component name from the asreml() mbf list argument.

grp

A component name from the asreml() group list argument.

p

The exponent in a power function term (pow).

offset

Constant added to obj; default 0.

t
pol:

The maximum degree of a set of orthogonal polynomials formed from obj. If negative, the intercept polynomial is omitted.

leg:

The maximum degree of a set of Legendre polynomials formed from obj. If negative, the intercept polynomial is omitted.

k

The number of equally spaced knot points for a cubic smoothing spline. If zero or omitted, k is set to asreml.options()$knots (default 50).

init

Optional initial value for the default identity variance model (idv) when used in the random formula.

lvls

Vector of levels of the conditioning factor (obj) that define the conditioning covariates formed by at. If numeric, lvls indexes the levels vector of obj; that is, levels(obj)[lvls].

times

Multiples (may be non-integer) of the design matrix for obj are added to the preceeding design matrix.

model

A formula of the form ~A+B+...|Z, where A and B define variance matrices for simple or compound model terms, and Z is a simple conditioning factor whose levels identify and determine the number of sub-matrices in the direct sum. The "|" operator is applied associatively and operates with all terms on its left; that is, A+B|C implies (A+B)|C and is equivalent to A|C+B|C.

levels

A list of length the number of terms in the left hand side of model that are separated by "+". The components of levels are vectors of unique values of Z. If there is only one term in the left hand side of model (or if the context allows, see examples) then levels may be a vector. If levels is numeric, then these are ordinal numbers that refer to the sections defined by Z in unique(Z) order. If NULL, the default is to use unique(Z).

outer

if TRUE, independent blocks of correlated observations are modelled with common variance and correlation parameters; the blocks can be of different sizes.

contr

An integer vector of contrast coefficients parallel to levels(obj).

Functions

Examples

## Not run: 

## separable autoregressive residual model at each level of Site
residual = ~ dsum(~ ar1(Column):ar1(Row) | Site)

## different residual models at different levels of site
## the ordinals in the levels list refer to the unique values of
## Site in unique(Site) order.
residual = ~ dsum(~ ar1(Column):ar1(Row) + id(Column):ar1(Row) | Site,
                levels = list(c(1,3), c(2,4)))

## equivalent
residual = ~ dsum(~ ar1(Column):ar1(Row) | Site, levels=c(1,3))
          + dsum(~ id(Column):ar1(Row)  | Site, levels=c(2,4))

## "biological" Date within Plot
residual = ~ dsum(~ ar1(Date) | Plot, outer=TRUE)

## "explicit" times
residual = ~ dsum(~ exp(Date) | Plot, outer=TRUE)

## End(Not run)


[Package asreml version 4.1.0.106 Index]