snp.long {SimHap} | R Documentation |
snp.long
is used to fit linear mixed effects models to single SNP genotype and phenotype data for longitudinal outcomes.
snp.long(fixed, random, geno, pheno, cor = "corCAR1", form=~1, value = 0.2, 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. |
geno |
a dataframe containing genotype data. |
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 . |
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. |
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 . |
sub |
an expression representing a subset of the data on which to perform the models. |
snp.long
returns an object of 'class' snpLong
.
The summary
function can be used to obtain and print a
summary of the results.
An object of class snpLong
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. |
ANOD |
analysis of deviance table for the fitted model. |
logLik |
the log-likelihood for the fitted model. |
fit.lme |
a lme object fit using formula. |
AIC |
Akaike Information Criterion for the fitted model. |
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.
data(SNPlong.dat) # transforms SNPlong.dat to an object containing 3 columns # per SNP - additive, dominant and recessive, where genotypes # defined in 'baseline' serve as the baseline genotypes longGeno.dat <- SNP2Geno(SNPlong.dat, baseline=c("AA", "GG", "V2V2")) data(longPheno.dat) mymodel <- snp.long(fixed=fev1f~height+weight+SNP_1_add, random=~1|id, geno=longGeno.dat, pheno=longPheno.dat, form=~year|id) summary(mymodel) # example with a subsetting variable, looking at males only mymodel <- snp.long(fixed=fev1f~height+weight+SNP_1_add, random=~1|id, geno=longGeno.dat, pheno=longPheno.dat, form=~year|id, sub=expression(sex==1)) summary(mymodel)