binomialff(VGAM)
binomialff()所属R语言包:VGAM
Binomial Family Function
二项式家庭功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Family function for fitting generalized linear models to binomial responses, where the dispersion parameter may be known or unknown.
家庭功能的拟合广义线性模型,二项式反应,分散参数可以是已知或未知的。
用法----------Usage----------
binomialff(link = "logit", earg = list(), dispersion = 1, mv = FALSE,
onedpar = !mv, parallel = FALSE, zero = NULL)
参数----------Arguments----------
参数:link, earg
Link function and extra argument optionally used by the link function. See Links for more choices, and also CommonVGAMffArguments for more information.
Link功能和额外的参数可以使用链接功能。见Links更多的选择,也CommonVGAMffArguments更多信息。
参数:dispersion
Dispersion parameter. By default, maximum likelihood is used to estimate the model because it is known. However, the user can specify dispersion = 0 to have it estimated, or else specify a known positive value (or values if mv is TRUE).
分散参数。缺省情况下,最大似然,因为它是已知的用于对模型进行估计。但是,用户可以指定dispersion = 0有它的估计,否则指定一个已知的正面价值(或mv值是TRUE)。
参数:mv
Multivariate response? If TRUE, then the response is interpreted as M independent binary responses, where M is the number of columns of the response matrix. In this case, the response matrix should have zero/one values only. If FALSE and the response is a (2-column) matrix, then the number of successes is given in the first column, and the second column is the number of failures.
多因素反应呢?如果TRUE,然后响应被解释为M独立的二进制响应,其中M是响应矩阵的列的数量。响应矩阵在这种情况下,应该有只0/1值。如果FALSE和响应是一个(2列)的矩阵,然后给出成功的次数在第一列中,和第二列是失败的次数。
参数:onedpar
One dispersion parameter? If mv, then a separate dispersion parameter will be computed for each response (column), by default. Setting onedpar = TRUE will pool them so that there is only one dispersion parameter to be estimated.
一个分散参数?如果mv,然后一个单独的分散参数计算每个响应(列),默认情况下。设置onedpar = TRUE集中,所以只有一个分散参数进行估计。
参数:parallel
A logical or formula. Used only if mv is TRUE. This argument allows for the parallelism assumption whereby the regression coefficients for a variable is constrained to be equal over the M linear/additive predictors.
一个逻辑或公式。使用,只有mv是TRUE。该参数允许的并行假设变量的回归系数限制为相等的M线性/添加剂的预测。
参数:zero
An integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. The values must be from the set {1,2,...,M}, where M is the number of columns of the matrix response.
指定一个整数值向量线性/添加剂的预测模型仅作为拦截。这些值必须是从集合{1,2,...,M},其中M是数列的矩阵响应。
Details
详细信息----------Details----------
This function is largely to mimic binomial, however there are some differences.
此功能主要是模仿binomial,但也有一些差异。
If the dispersion parameter is unknown, then the resulting estimate is not fully a maximum likelihood estimate (see pp.124–8 of McCullagh and Nelder, 1989).
如果分散参数是未知的,那么所得到的估计是不完全的最大似然估计(见pp.124-8 McCullagh和Nelder,1989年)。
A dispersion parameter that is less/greater than unity corresponds to under-/over-dispersion relative to the binomial model. Over-dispersion is more common in practice.
一个的分散参数是小于/大于团结对应under-/over-dispersion相对于二项式模型。过度分散在实践中是比较常见的。
Setting mv = TRUE is necessary when fitting a Quadratic RR-VGLM (see cqo) because the response is a matrix of M columns (e.g., one column per species). Then there will be M dispersion parameters (one per column of the response matrix).
设置mv = TRUE是必要的,装修时一个二次RR-VGLM的(见cqo),因为响应是一个矩阵M列(例如,每个物种的一列)。然后会出现M的分散参数(每列的响应矩阵)。
When used with cqo and cao, it may be preferable to use the cloglog link.
当使用cqo和cao,它可能是最好使用cloglog链接。
值----------Value----------
An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, vgam, rrvglm, cqo, and cao.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能,如vglm,vgam,rrvglm,cqo和cao。
警告----------Warning ----------
With a multivariate response, assigning a known dispersion parameter for each response is not handled well yet. Currently, only a single known dispersion parameter is handled well.
了一个多变量的响应,每个响应分配已知的分散的参数没有处理好。目前,只有一个已知的分散参数处理好了。
The maximum likelihood estimate will not exist if the data is completely separable or quasi-completely separable. See Chapter 10 of Altman et al. (2004) for more details, and safeBinaryRegression. Yet to do: add a sepcheck = TRUE, say, argument to detect this problem and give an appropriate warning.
如果数据是完全分离或准完全分离的最大似然估计将不存在。请参阅第10章奥特曼等。 (2004年)的更多细节,和safeBinaryRegression。但做的事:添加一个sepcheck = TRUE说,参数,检测到这个问题,并给予适当的警告。
注意----------Note----------
If mv is FALSE (default) then the response can be of one of two formats: a factor (first level taken as failure), or a 2-column matrix (first column = successes) of counts. The argument weights in the modelling function can also be specified as any vector of positive values. In general, 1 means success and 0 means failure (to check, see the y slot of the fitted object). Note that a general vector of proportions of success is no longer accepted.
如果mv是FALSE(默认值),然后响应可以是两种格式之一:一个因子(第一电平视为失败),或2列的矩阵(第一列=成功)的计数。参数weights的建模功能也可以被指定为任何正面的价值观的向量。在一般情况下,1表示成功,0表示失败(要检查,看看y插槽的合身的对象)。需要注意的是矢量成功的比例一般不再接受。
The notation M is used to denote the number of linear/additive predictors.
符号M是用来表示线性/添加剂预测因子的数目。
If mv is TRUE, then the matrix response can only be of one format: a matrix of 1's and 0's (1 = success).
如果mv是TRUE,那么矩阵响应只能是一种格式:一个矩阵的1和0(1 =成功)。
The call binomialff(dispersion = 0, ...) is equivalent to quasibinomialff(...). The latter was written so that R users of quasibinomial() would only need to add a “ff” to the end of the family function name.
呼叫binomialff(dispersion = 0, ...)是相当于quasibinomialff(...)。后者是使Rquasibinomial()用户只需要添加一个“ff”家庭的功能名称。
Regardless of whether the dispersion parameter is to be estimated or not, its value can be seen from the output from the summary() of the object.
无论是否分散参数是要估计或没有,可以看出,它的值从输出从summary()的对象。
Fisher scoring is used. This can sometimes fail to converge by oscillating between successive iterations (Ridout, 1990). See the example below.
使用Fisher评分。有时,这可以通过连续迭代(Ridout,1990)之间的振荡不收敛。请看下面的例子。
(作者)----------Author(s)----------
Thomas W. Yee
参考文献----------References----------
Generalized Linear Models, 2nd ed. London: Chapman & Hall.
Numerical Issues in Statistical Computing for the Social Scientist, Hoboken, NJ, USA: Wiley-Interscience.
Non-convergence of Fisher's method of scoring—a simple example. GLIM Newsletter, 20(6).
参见----------See Also----------
quasibinomialff, Links, rrvglm, cqo, cao, betabinomial, posbinomial, zibinomial, dexpbinomial, mbinomial, seq2binomial, amlbinomial, simplex, binomial, safeBinaryRegression.
quasibinomialff,Links,rrvglm,cqo,cao,betabinomial,posbinomial,zibinomial,dexpbinomial,mbinomial,seq2binomial,amlbinomial,simplex,binomial,safeBinaryRegression。
实例----------Examples----------
quasibinomialff()
quasibinomialff(link = "probit")
shunua = hunua[sort.list(with(hunua, altitude)), ] # Sort by altitude[高海拔排序]
fit = vglm(agaaus ~ poly(altitude, 2), binomialff(link = cloglog), shunua)
## Not run: [#不运行:]
plot(agaaus ~ jitter(altitude), shunua, col = "blue", ylab = "P(Agaaus = 1)",
main = "Presence/absence of Agathis australis", las = 1)
with(shunua, lines(altitude, fitted(fit), col = "orange", lwd = 2))
## End(Not run)[#(不执行)]
# Fit two species simultaneously[同时适合两个物种]
fit2 = vgam(cbind(agaaus, kniexc) ~ s(altitude), binomialff(mv = TRUE), shunua)
with(shunua, matplot(altitude, fitted(fit2), type = "l",
main = "Two species response curves", las = 1))
# Shows that Fisher scoring can sometime fail. See Ridout (1990).[显示,费舍尔得分的某个时候失败。 Ridout(1990年)。]
ridout = data.frame(v = c(1000, 100, 10), r = c(4, 3, 3), n = c(5, 5, 5))
(ridout = transform(ridout, logv = log(v)))
# The iterations oscillates between two local solutions:[迭代之间振荡两个本地的解决方案:]
glm.fail = glm(r / n ~ offset(logv) + 1, weight = n,
binomial(link = cloglog), ridout, trace = TRUE)
coef(glm.fail)
# vglm()'s half-stepping ensures the MLE of -5.4007 is obtained:[vglm()的半步,确保获得MLE -5.4007:]
vglm.ok = vglm(cbind(r, n-r) ~ offset(logv) + 1,
binomialff(link = cloglog), ridout, trace = TRUE)
coef(vglm.ok)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|