Learn R Programming

BIOdry (version 0.3)

lmeForm: LME formula

Description

LME formula with grouping levels being defined by factor-level columns in a data frame.

Usage

lmeForm(rd, prim.cov = FALSE, resp = NULL, covar = NULL, lev.rm = NULL)

Arguments

rd
data.frame object with fator-level columns.
prim.cov
Logical: should the formula be printed in the form of primary covariate: '~ cov'? If FALSE then a complete form: 'resp ~ covar | group' is formulated.
resp
NULL or character. Column name of the response. If NULL name of the first numeric column of the data frame is used.
covar
NULL or character. Column name(s) of the covariate(s). If NULL name of the first temporal column in the data frame is used.
lev.rm
NULL, character or numeric vector of levels in the data frame to be removed from the groups.

Value

with any of the forms: resp ~ cov | group or ~ cov.

References

Pinheiro J. C., D. M. Bates. 2000. Mixed-effects models in S and S-PLUS. Springer, New York.

Examples

Run this code
##Multilevel data frame of tree-ring widths:
data(Prings05,,envir = environment())

 ## groupedData object with  lmeForm 
gdata <- groupedData(lmeForm(Prings05,lev.rm = 1),data = Prings05)
plot(gdata,groups = ~ sample)

## LME formula in form of covariate:
form1 <- lmeForm(Prings05,prim.cov = FALSE)
print(form1)

Run the code above in your browser using DataLab