找回密码
 注册
查看: 2689|回复: 0

R语言:anova.lme()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:28:00 | 显示全部楼层 |阅读模式
anova.lme(nlme)
anova.lme()所属R语言包:nlme

                                        Compare Likelihoods of Fitted Objects
                                         比较合身对象的似然性

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

When only one fitted model object is present, a data frame with the sums of squares, numerator degrees of freedom, denominator degrees of freedom, F-values, and P-values for Wald tests for the terms in the model (when Terms and L are NULL), a combination of model terms (when Terms in not NULL), or linear combinations of the model coefficients (when L is not NULL). Otherwise, when multiple fitted objects are being compared, a data frame with the degrees of freedom, the (restricted) log-likelihood, the Akaike Information Criterion (AIC), and the Bayesian Information Criterion (BIC) of each object is returned. If test=TRUE, whenever two consecutive  objects have different number of degrees of freedom, a likelihood ratio statistic, with the associated p-value is included in the returned data frame.   
当只有一个拟合模型对象是目前,广场,自由程度的分子,分母自由度,F值,P值模型中的条款瓦尔德测试的款项数据框(当<X >和Terms是L),模型计算的组合(当NULL不Terms),或线性组合模型系数(当NULL 不L)。否则,当多个拟合对象相比,与数据框的自由度,限制日志的可能性,赤池信息准则(AIC)和贝叶斯信息标准(BIC),每个对象被返回。如果NULL,每当连续两个对象有不同数量的自由度,似然比统计,与相关的p值是包含在返回的数据框。


用法----------Usage----------


## S3 method for class 'lme'
anova(object, ..., test, type, adjustSigma, Terms, L, verbose)
## S3 method for class 'anova.lme'
print(x, verbose, ...)



参数----------Arguments----------

参数:object
a fitted model object inheriting from class lme, representing a mixed-effects model.
继承类lme代表的混合效应模型,拟合模型对象。


参数:...
other optional fitted model objects inheriting from classes gls, gnls, lm, lme, lmList, nlme, nlsList, or nls.
其他可选的拟合模型对象类继承gls,gnls,lm,lme,lmList,nlme,nlsList或nls。


参数:test
an optional logical value controlling whether likelihood ratio tests should be used to compare the fitted models represented by object and the objects in .... Defaults to TRUE.
一个可选的逻辑值,控制是否应使用比较object和在...对象代表的拟合模型似然比测试。 TRUE默认。


参数:type
an optional character string specifying the type of sum of squares to be used in F-tests for the terms in the model. If  "sequential", the sequential sum of squares obtained by including the terms in the order they appear in the model is used; else, if "marginal", the marginal sum of squares obtained by deleting a term from the model at a time is used. This argument is only used when a single fitted object is passed to the function. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to "sequential".
一个可选的字符串,指定用于模型中的条款将在F检验的平方的总和。如果"sequential"使用,包括他们在模型中出现的顺序方面取得的连续平方的总和;否则,如果"marginal",从模型中删去任期获得的边际平方的总和在使用时间。这种说法是只用一个单一的拟合对象传递给函数。使用部分匹配的参数,所以才有了第一个字符需要提供。 "sequential"默认。


参数:adjustSigma
an optional logical value. If TRUE and the estimation method used to obtain object was maximum likelihood, the residual standard error is multiplied by sqrt(nobs/(nobs - npar)), converting it to a REML-like estimate. This argument is only used when a single fitted object is passed to the function. Default is TRUE.  
一个可选的逻辑值。如果TRUE和估计方法,用于获取object最大的可能性,剩余标准误差乘以sqrt(nobs/(nobs - npar)),把它转换到REML法类似的估计。这种说法是只用一个单一的拟合对象传递给函数。默认TRUE。


参数:Terms
an optional integer or character vector specifying which terms in the model should be jointly tested to be zero using a Wald F-test. If given as a character vector, its elements must correspond to term names; else, if given as an integer vector, its elements must correspond to the order in which terms are included in the model. This argument is only used when a single fitted object is passed to the function. Default is NULL.  
一个可选的整数或指定模型的条款应联合测试使用沃尔德F检验为零的特征向量。如果作为一个特征向量,其元素必须符合以长远名称;否则,如果作为一个整数向量,其元素必须在其中的条款包括在模型中的顺序相对应。这种说法是只用一个单一的拟合对象传递给函数。默认NULL。


参数:L
an optional numeric vector or array specifying linear combinations of the coefficients in the model that should be tested to be zero. If given as an array, its rows define the linear combinations to be tested. If names are assigned to the vector elements (array columns), they must correspond to coefficients names and will be used to map the linear combination(s) to the coefficients; else, if no names are available, the vector elements (array columns) are assumed in the same order as the coefficients appear in the model. This argument is only used when a single fitted object is passed to the function. Default is NULL.
一个可选的数字向量或数组指定应测试模型是零系数的线性组合。如果作为一个数组,其行定义的线性组合进行测试。如果名称分配给向量元素(数组列),他们必须符合系数的名字,将被用来映射系数的线性组合(S);否则,如果没有可用的名称是,向量元素(数组列)假设在相同的顺序出现在模型系数。这种说法是只用一个单一的拟合对象传递给函数。默认NULL。


参数:x
an object inheriting from class anova.lme
一个对象,继承类anova.lme


参数:verbose
an optional logical value. If TRUE, the calling sequences for each fitted model object are printed with the rest of the output, being omitted if verbose = FALSE. Defaults to FALSE.
一个可选的逻辑值。如果TRUE如果verbose = FALSE,每个拟合模型对象的调用序列,其余的输出打印,被省略。 FALSE默认。


值----------Value----------

a data frame inheriting from class anova.lme.
继承类anova.lme一个数据框。


注意----------Note----------

Likelihood comparisons are not meaningful for objects fit using restricted maximum likelihood and with different fixed effects.
可能性比较有意义的对象,适合使用约束最大似然不同的固定效果。


作者(S)----------Author(s)----------


Jose Pinheiro and Douglas Bates <a href="mailto:bates@stat.wisc.edu">bates@stat.wisc.edu</a>



参考文献----------References----------

in S and S-PLUS&quot;, Springer.  

参见----------See Also----------

gls, gnls, nlme, lme, AIC, BIC, print.anova.lme, logLik.lme,
gls,gnls,nlme,lme,AIC,BIC,print.anova.lme,logLik.lme


举例----------Examples----------


fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)
anova(fm1)
fm2 <- update(fm1, random = pdDiag(~age))
anova(fm1, fm2)

# Pinheiro and Bates, pp. 251-254[皮涅伊罗和贝茨,第251-254]
fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont,
            correlation = corSymm(form = ~ 1 | Subject),
            weights = varIdent(form = ~ 1 | age))
fm2Orth.gls <- update(fm1Orth.gls,
                corr = corCompSymm(form = ~ 1 | Subject))
# anova.gls[anova.gls]
anova(fm1Orth.gls, fm2Orth.gls)
fm3Orth.gls <- update(fm2Orth.gls, weights = NULL)
# anova.gls[anova.gls]
anova(fm2Orth.gls, fm3Orth.gls)
fm4Orth.gls <- update(fm3Orth.gls,
                 weights = varIdent(form = ~ 1 | Sex))
# anova.gls[anova.gls]
anova(fm3Orth.gls, fm4Orth.gls)
# not in book but needed for the following command[没有书,但以下命令所需]
fm3Orth.lme <-
    lme(distance~Sex*I(age-11), data = Orthodont,
        random = ~ I(age-11) | Subject,
        weights = varIdent(form = ~ 1 | Sex))
# anova.lme to compare an "lme" object with a "gls" object [anova.lme比较“GLS”对象的对象“LME”]
anova(fm3Orth.lme, fm4Orth.gls, test = FALSE)

# Pinheiro and Bates, pp. 222-225[皮涅伊罗和贝茨,第222-225]
options(contrasts = c("contr.treatment", "contr.poly"))
fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight,
                   random = ~ Time)
fm2BW.lme <- update(fm1BW.lme, weights = varPower())
# Test a specific contrast[具体对比测试]
anova(fm2BW.lme, L = c("Timeiet2" = 1, "Timeiet3" = -1))

fm1Theo.lis <- nlsList(
     conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data=Theoph)
fm1Theo.lis

# Pinheiro and Bates, pp. 352-365[皮涅伊罗和贝茨,第352-365]
fm1Theo.lis <- nlsList(
     conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data=Theoph)
fm1Theo.nlme <- nlme(fm1Theo.lis)
fm2Theo.nlme <- update(fm1Theo.nlme,
   random=pdDiag(lKe+lKa+lCl~1) )
fm3Theo.nlme <- update(fm2Theo.nlme,
   random=pdDiag(lKa+lCl~1) )

# anova comparing 3 models[方差分析比较3款车型]
anova(fm1Theo.nlme, fm3Theo.nlme, fm2Theo.nlme)


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 13:07 , Processed in 0.024727 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表