epi.long {SimHap} | R Documentation |
epi.long
is used to fit linear mixed effects models to epidemiological data with longitudinal outcomes.
epi.long(fixed, random, pheno, cor="corCAR1", value = 0.2, form=~1, sub = NULL)
fixed |
as per lme . A two-sided linear formula object describing the fixed-effects part of the model including SNP parameters, with the response on the left of a ~ operator and the terms, separated by + operators. |
random |
as per lme . A one-sided formula of the form ~x1+...+xn | g1/.../gm , with x1+...+xn specifying the model for the random effects and g1/.../gm the grouping structure (m may be equal to 1, in which case no / is required). The random effects formula will be repeated for all levels of grouping, in the case of multiple levels of grouping. |
pheno |
a dataframe containing phenotype data. |
cor |
a corStruct object describing the within-group correlation structure. Available correlation structures are corAR1 , corCAR1 , and corCompSymm . See the documentation of corClasses for a description of these. Defaults to corCAR1 . |
value |
for corAR1 - the value of the lag 1 autocorrelation, which must be between -1 and 1. For corCAR1 - the correlation between two observations one unit of time apart. Must be between 0 and 1. For corCompSymm - the correlation between any two correlated observations. Defaults to 0.2 . |
form |
a one sided formula of the form ~ t , or ~ t | g , specifying a time covariate t and, optionally, a grouping factor g . A covariate for this correlation structure must be integer valued. When a grouping factor is present in form , the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to ~ 1 , which corresponds to using the order of the observations in the data as a covariate, and no groups. |
sub |
an expression representing a subset of the data on which to perform the models. |
cor
will always default to corCAR1
and value
will always default to 0.2
. Be sure to change both parameters accordingly if desired. See corClasses
for more details.
epi.long
returns an object of class epiLong
.
The summary
function can be used to obtain and print a
summary of the results.
An object of class epiLong
is a list containing the
following components:
results |
a table containing the coefficients, standard errors and p-values of the parameter estimates. |
fixed_formula |
fixed effects formula. |
random_formula |
random effects formula. |
fit.lme |
a lme object fit using formula. |
ANOD |
analysis of deviance table for the fitted model. |
logLik |
the log-likelihood for the fitted model. |
AIC |
Akaike Information Criterion for the model fit using formula. |
corStruct |
correlation structure used in the fitted model. |
Pamela A McCaskie
Bates, D.M., Pinheiro, J.C. (1998) Computational methods for multilevel models. Available in PostScript or PDF formats at http://franz.stat.wisc.edu/pub/NLME/
Box, G.E.P., Jenkins, G.M., Reinsel, G.C. (1994) Time Series Analysis: Forecasting and Control, 3rd Edition, Holden-Day.
Davidian, M., Giltinan, D.M. (1995) Nonlinear Mixed Effects Models for Repeated Measurement Data, Chapman and Hall.
Laird, N.M., Ware, J.H. (1982) Random-Effects Models for Longitudinal Data, Biometrics, 38, 963-974.
Lindstrom, M.J., Bates, D.M. (1988) Newton-Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data, Journal of the American Statistical Association, 83, 1014-1022.
Littel, R.C., Milliken, G.A., Stroup, W.W., Wolfinger, R.D. (1996) SAS Systems for Mixed Models, SAS Institute.
McCaskie, P.A., Carter, K.W, Hazelton, M., Palmer, L.J. (2007) SimHap: A comprehensive modeling framework for epidemiological outcomes and a multiple imputation approach to haplotypic analysis of population-based data, [online] www.genepi.org.au/simhap.
Pinheiro, J.C., Bates, D.M. (1996) Unconstrained Parametrizations for Variance-Covariance Matrices, Statistics and Computing, 6, 289-296.
Pinheiro, J.C., Bates, D.M. (2000) Mixed-Effects Models in S and S-PLUS, Springer.
snp.long
, haplo.long
, corClasses
data(longPheno.dat) mymodel <- epi.long(fixed=fev1f~height+weight, random=~1|id, pheno=longPheno.dat, form=~year|id) summary(mymodel) # example with a subsetting variable, looking at males only mymodel <- epi.long(fixed=fev1f~height+weight, random=~1|id, pheno=longPheno.dat, form=~year|id, sub=expression(sex==1)) summary(mymodel)