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

R语言 VGAM包 cumulative()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 15:31:21 | 显示全部楼层 |阅读模式
cumulative(VGAM)
cumulative()所属R语言包:VGAM

                                         Ordinal Regression with Cumulative Probabilities
                                         序回归与累积概率

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

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

Fits a cumulative link regression model to a (preferably ordered) factor response.
适合的累计链接回归模型(最好是订购)因子反应。


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


cumulative(link = "logit", earg = list(), parallel = FALSE,
           reverse = FALSE, mv = FALSE, intercept.apply = FALSE,
           whitespace = FALSE)



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

参数:link
Link function applied to the J cumulative probabilities.  See Links for more choices, e.g., for the cumulative probit/cloglog/cauchit/... models.  
Link功能的J累积概率。见Links更多的选择,例如,为的累计probit/cloglog/cauchit/ ...模型。


参数:earg
List. Extra argument for the link function. See earg in Links for general information.  
列表。额外的参数的链接功能。见earg中Links的一般信息。


参数:parallel
A logical  or formula specifying which terms have equal/unequal coefficients. See below for more information about the parallelism assumption.  
一个逻辑或公式确定有平等/不平等系数,其条款。的更多信息,请参阅下面的假设的并行。


参数:reverse
Logical. By default, the cumulative probabilities used are P(Y<=1), P(Y<=2), ..., P(Y<=J). If reverse is TRUE then  P(Y>=2), P(Y>=3), ..., P(Y>=J+1) are used.  This should be set to TRUE for link= golf, polf, nbolf. For these links the cutpoints must be an increasing sequence; if reverse = FALSE for then the cutpoints must be an decreasing sequence.  
逻辑。默认情况下,使用的累积概率是P(Y<=1),P(Y<=2),...,P(Y<=J)。 reverse如果是TRUE然后P(Y>=2),P(Y>=3),...,P(Y>=J+1)。这应该被设置为TRUElink=golf,polf,nbolf。对于这些链接的分割点必须是一个递增的序列,如果reverse = FALSE然后分割点必须是一个递减的序列。


参数:mv
Logical. Multivariate response? If TRUE then the input should be a matrix with values 1,2,&hellip;,L, where L=J+1 is the number of levels. Each column of the matrix is a response, i.e., multivariate response. A suitable matrix can be obtained from Cut.  
逻辑。多因素反应呢?如果TRUE然后输入应该是一个矩阵的值1,2,&hellip;,L,其中L=J+1的水平是多少。该矩阵的每一列是一个响应,即,多元响应。一个合适的基质可以从Cut。


参数:intercept.apply
Logical. Whether the parallel argument should be applied to the intercept term. This should be set to TRUE for link= golf, polf, nbolf.  
逻辑。无论parallel参数应适用于截距项。这应该被设置为TRUElink=golf,polf,nbolf。


参数:whitespace
See CommonVGAMffArguments for information.  
见CommonVGAMffArguments的信息。


Details

详细信息----------Details----------

In this help file the response Y is assumed to be a factor with ordered values 1,2,&hellip;,J+1. Hence M is the number of linear/additive predictors eta_j; for cumulative() one has M=J.
本帮助文件中的响应Y被认为是一个因素,有序值1,2,&hellip;,J+1。因此M是数的线性/添加剂预测eta_j,cumulative()1M=J的。

This VGAM family function fits the class of cumulative link models to (hopefully) an ordinal response. By default, the non-parallel cumulative logit model is fitted, i.e.,
这VGAM家庭功能适合之类的链路累积模型(希望)一个序响应。默认情况下,非平行安装累积Logit模型,即

where j=1,2,&hellip;,M and the eta_j are not constrained to be parallel. This is also known as the non-proportional odds model. If the logit link is replaced by a complementary log-log link  (cloglog) then this is known as the proportional-hazards model.
j=1,2,&hellip;,M和eta_j不限制平行。这也被称为非比例优势模型。如果logit的关联互补的log,log链接(取代cloglog),那么这个被称为比例风险模型。

In almost all the literature, the constraint matrices associated with this family of models are known. For example, setting parallel = TRUE will make all constraint matrices (except for the intercept) equal to a vector of M 1's. If the constraint matrices are equal, unknown and to be estimated, then this can be achieved by fitting the model as a reduced-rank vector generalized linear model (RR-VGLM; see rrvglm). Currently, reduced-rank vector generalized additive models (RR-VGAMs) have not been implemented here.
在几乎所有的文学,与该系列机型的约束矩阵是已知的。例如,设置parallel = TRUE将尽一切约束矩阵(用于拦截除外)等M1的向量。如果约束矩阵都是平等的,未知的,要估计,那么这个可以实现的拟合模型为降秩向量广义线性模型(RR-VGLM; rrvglm“)。目前,降秩向量广义相加模型(RR-VGAMs)没有在这里实现。


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

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能,如vglm,vgam。


警告----------Warning ----------

No check is made to verify that the response is ordinal; see ordered.
不进行任何检查来验证的响应顺序; ordered。


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

The response should be either a matrix of counts (with row sums that are all positive), or a factor. In both cases, the y slot returned by vglm/vgam/rrvglm is the matrix of counts. The formula must contain an intercept term. Other VGAM family functions for an ordinal response include acat, cratio, sratio. For a nominal (unordered) factor response, the multinomial logit model (multinomial) is more appropriate.
该反应应该是一个矩阵的计数(与行的款项都是正面),或一个因素。在这两种情况下,y返回vglm插槽/vgam/rrvglm是矩阵的计数。公式必须包含截距项。其他VGAM家庭为序响应的功能包括acat,cratio,sratio。对于标称值(无序的)因素的反应,多项式Logit模型(multinomial)是比较合适的。

With the logit link, setting parallel = TRUE will fit a proportional odds model. Note that the TRUE here does not apply to the intercept term.  In practice, the validity of the proportional odds assumption needs to be checked, e.g., by a likelihood ratio test (LRT). If acceptable on the data, then numerical problems are less likely to occur during the fitting, and there are less parameters. Numerical problems occur when the linear/additive predictors cross, which results in probabilities outside of (0,1); setting parallel = TRUE will help avoid this problem.
logit的关联,设置parallel = TRUE适合比例优势模型。请注意TRUE这里不适用截距项。在实践中,比例优势假设的有效性,需要进行检查,例如,通过似然比检验(LRT)。如果可以接受的数据,那么数值问题不太可能发生的嵌合过程中,有更少的参数。数值出现问题,线性/对添加剂的预测交叉,这将导致在外面的概率(0,1)设置parallel = TRUE将有助于避免这个问题。

Here is an example of the usage of the parallel argument. If there are covariates x2, x3 and x4, then parallel = TRUE ~ x2 + x3 -1 and parallel = FALSE ~ x4 are equivalent. This would constrain the regression coefficients for x2 and x3 to be equal; those of the intercepts and x4 would be different.
下面是一个例子parallel参数的使用。如果有协变量x2,x3和x4,那么parallel = TRUE ~ x2 + x3 -1和parallel = FALSE ~ x4是等效的。这将限制的回归系数x2和x3是相等的;的拦截和x4会有所不同。

If the data is inputted in long format (not wide format, as in pneumo below) and the self-starting initial values are not good enough then try using mustart, coefstart and/or  etatstart. See the example below.
如果数据被输入在长格式(不宽的格式,如pneumo下面)和自启动的初始值不够好,然后尝试使用mustart,coefstart和/或etatstart。请看下面的例子。

To fit the proportional odds model one can use the VGAM family function propodds. Note that propodds(reverse) is equivalent to  cumulative(parallel = TRUE, reverse = reverse) (which is equivalent to cumulative(parallel = TRUE, reverse = reverse, link = "logit")). It is for convenience only. A call to cumulative() is preferred since it reminds the user that a parallelism assumption is made, as well as being a lot more flexible.
为了适应不同的比例优势模型可以使用VGAM家庭函数propodds。请注意,propodds(reverse)是相当于cumulative(parallel = TRUE, reverse = reverse)(这是相当于cumulative(parallel = TRUE, reverse = reverse, link = "logit"))。它仅仅是为了方便。呼叫cumulative()是首选,因为它提醒用户,并行假设,以及很多更灵活。


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


Thomas W. Yee



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

Categorical Data Analysis, 2nd ed. New York: Wiley.
Analysis of Ordinal Categorical Data, 2nd ed. New York: Wiley.
An Introduction to Generalized Linear Models, 3rd ed. Boca Raton: Chapman &amp; Hall/CRC Press.
Generalized Linear Models, 2nd ed. London: Chapman &amp; Hall.
Analyzing Categorical Data, New York: Springer-Verlag.
The <code>VGAM</code> package for categorical data analysis. Journal of Statistical Software, 32, 1&ndash;34. http://www.jstatsoft.org/v32/i10/.
Vector generalized additive models. Journal of the Royal Statistical Society, Series B, Methodological, 58, 481&ndash;493.
by the <code>VGAM</code> package can be found at http://www.stat.auckland.ac.nz/~yee/VGAM/doc/categorical.pdf.

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

propodds, prplot, margeff, acat, cratio, sratio, multinomial, pneumo, Links, logit, probit, cloglog, cauchit, golf, polf, nbolf, logistic1.
propodds,prplot,margeff,acat,cratio,sratio,multinomial,pneumo,Links,logit,probit,cloglog,cauchit,golf,polf,nbolf,logistic1 。


实例----------Examples----------


# Fit the proportional odds model, p.179, in McCullagh and Nelder (1989)[适合的比例优势模型,第179页,McCullagh和Nelder(1989)]
pneumo = transform(pneumo, let = log(exposure.time))
(fit = vglm(cbind(normal, mild, severe) ~ let,
            cumulative(parallel = TRUE, reverse = TRUE), pneumo))
depvar(fit)   # Sample proportions (good technique)[样本比例(好技术)]
fit@y         # Sample proportions (bad technique)[样本比例(坏的技术)]
weights(fit, type = "prior")   # Number of observations[若干意见]
coef(fit, matrix = TRUE)
constraints(fit)   # Constraint matrices[约束矩阵]

# Check that the model is linear in let ----------------------[检查,该模型是线性的,让----------------------]
fit2 = vgam(cbind(normal, mild, severe) ~ s(let, df = 2),
            cumulative(reverse = TRUE), pneumo)
## Not run:  plot(fit2, se = TRUE, overlay = TRUE, lcol = 1:2, scol = 1:2) [#未运行图(FIT2,SE = TRUE,覆盖= TRUE,LCOL = 1:2,SCOL = 1:2)]

# Check the proportional odds assumption with a LRT ----------[检查的比例赔率假设与轻铁----------]
(fit3 = vglm(cbind(normal, mild, severe) ~ let,
             cumulative(parallel = FALSE, reverse = TRUE), pneumo))
pchisq(2 * (logLik(fit3) - logLik(fit)),
       df = length(coef(fit3)) - length(coef(fit)), lower.tail = FALSE)
lrtest(fit3, fit)  # More elegant[更优雅]

# A factor() version of fit ----------------------------------[一个因素()版本,适合----------------------------------]
# This is in long format (cf. wide format above)[这是在长格式(见上述格式)]
Nobs = round(depvar(fit) * c(weights(fit, type = "prior")))
sumNobs = colSums(Nobs) # apply(Nobs, 2, sum)[申请(NOBS,2,总结)]

pneumo.long =
  data.frame(symptoms = ordered(rep(rep(colnames(Nobs), nrow(Nobs)),
                                        times = c(t(Nobs))),
                                levels = colnames(Nobs)),
             let = rep(rep(with(pneumo, let), each = ncol(Nobs)),
                       times = c(t(Nobs))))
with(pneumo.long, table(let, symptoms)) # Check it; should be same as pneumo[检查,一样肺炎的]


(fit.long1 = vglm(symptoms ~ let, data = pneumo.long,
             cumulative(parallel = TRUE, reverse = TRUE), trace = TRUE))
coef(fit.long1, matrix = TRUE) # Should be same as coef(fit, matrix = TRUE)[应该是一样的系数(适合,矩阵= TRUE)]
# Could try using mustart if fit.long1 failed to converge.[可以尝试使用mustart如果fit.long1没有收敛。]
mymustart = matrix(sumNobs / sum(sumNobs),
                   nrow(pneumo.long), ncol(Nobs), byrow = TRUE)
fit.long2 = vglm(symptoms ~ let,
                fam = cumulative(parallel = TRUE, reverse = TRUE),
                mustart = mymustart, data = pneumo.long, trace = TRUE)
coef(fit.long2, matrix = TRUE) # Should be same as coef(fit, matrix = TRUE)[应该是一样的系数(适合,矩阵= TRUE)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 19:25 , Processed in 0.035558 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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