influence.measures(stats)
influence.measures()所属R语言包:stats
Regression Deletion Diagnostics
回归删除诊断
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This suite of functions can be used to compute some of the regression (leave-one-out deletion) diagnostics for linear and generalized linear models discussed in Belsley, Kuh and Welsch (1980), Cook and Weisberg (1982), etc.
此功能套件,可以用来计算一些回归(留一出缺失)Belsley山和威尔什(1980),库克和韦斯伯格(1982)等在讨论线性和广义线性模型的诊断
用法----------Usage----------
influence.measures(model)
rstandard(model, ...)
## S3 method for class 'lm'
rstandard(model, infl = lm.influence(model, do.coef = FALSE),
sd = sqrt(deviance(model)/df.residual(model)), ...)
## S3 method for class 'glm'
rstandard(model, infl=influence(model, do.coef=FALSE),
type=c("deviance","pearson"), ...)
rstudent(model, ...)
## S3 method for class 'lm'
rstudent(model, infl = lm.influence(model, do.coef = FALSE),
res = infl$wt.res, ...)
## S3 method for class 'glm'
rstudent(model, infl = influence(model, do.coef = FALSE), ...)
dffits(model, infl = , res = )
dfbeta(model, ...)
## S3 method for class 'lm'
dfbeta(model, infl = lm.influence(model, do.coef = TRUE), ...)
dfbetas(model, ...)
## S3 method for class 'lm'
dfbetas(model, infl = lm.influence(model, do.coef = TRUE), ...)
covratio(model, infl = lm.influence(model, do.coef = FALSE),
res = weighted.residuals(model))
cooks.distance(model, ...)
## S3 method for class 'lm'
cooks.distance(model, infl = lm.influence(model, do.coef = FALSE),
res = weighted.residuals(model),
sd = sqrt(deviance(model)/df.residual(model)),
hat = infl$hat, ...)
## S3 method for class 'glm'
cooks.distance(model, infl = influence(model, do.coef = FALSE),
res = infl$pear.res,
dispersion = summary(model)$dispersion,
hat = infl$hat, ...)
hatvalues(model, ...)
## S3 method for class 'lm'
hatvalues(model, infl = lm.influence(model, do.coef = FALSE), ...)
hat(x, intercept = TRUE)
参数----------Arguments----------
参数:model
an R object, typically returned by lm or glm.
R对象,通常返回lm或glm。
参数:infl
influence structure as returned by lm.influence or influence (the latter only for the glm method of rstudent and cooks.distance).
结构影响返回lm.influence或influence(glmrstudent和cooks.distance方法仅适用于后者的)。
参数:res
(possibly weighted) residuals, with proper default.
(可能是加权)残差,用正确的默认。
参数:sd
standard deviation to use, see default.
使用的标准偏差,请参阅默认。
参数:dispersion
dispersion (for glm objects) to use, see default.
色散(glm对象)使用,请参阅默认。
参数:hat
hat values H[i,i], see default.
帽子值H[i,i],看到默认。
参数:type
type of residuals for glm method for rstandard.
残差类型glm rstandard.方法
参数:x
the X or design matrix.
X或设计矩阵。
参数:intercept
should an intercept column be prepended to x?
截距列前缀x?
参数:...
further arguments passed to or from other methods.
通过进一步的论据或其他方法。
Details
详情----------Details----------
The primary high-level function is influence.measures which produces a class "infl" object tabular display showing the DFBETAS for each model variable, DFFITS, covariance ratios, Cook's distances and the diagonal elements of the hat matrix. Cases which are influential with respect to any of these measures are marked with an asterisk.
高层次的主要功能是influence.measures生产类"infl"对象表格显示每个模型变量的DFBETAS DFFITS,方差比率,库克的距离的帽子矩阵对角线元素。与这些措施影响的情况下,这是标有星号。
The functions dfbetas, dffits, covratio and cooks.distance provide direct access to the corresponding diagnostic quantities. Functions rstandard and rstudent give the standardized and Studentized residuals respectively. (These re-normalize the residuals to have unit variance, using an overall and leave-one-out measure of the error variance respectively.)
职能dfbetas,dffits,covratio和cooks.distance提供直接访问相应的诊断量。功能rstandard和rstudent标准化和学生化残差分别。 (这些重新正常化的残差方差,分别采用整体误差方差和留一出措施。)
Values for generalized linear models are approximations, as described in Williams (1987) (except that Cook's distances are scaled as F rather than as chi-square values). The approximations can be poor when some cases have large influence.
广义线性模型值近似,威廉姆斯(1987)(F,而不是卡方值缩放,库克的距离除外)。近似可以是穷人,在某些情况下有很大的影响。
The optional infl, res and sd arguments are there to encourage the use of these direct access functions, in situations where, e.g., the underlying basic influence measures (from lm.influence or the generic influence) are already available.
可选infl,res和sd论据,以鼓励使用这些直接访问功能的情况下,地方,例如,底层的基本影响的措施(从lm.influence或通用influence)已经可用。
Note that cases with weights == 0 are dropped from all these functions, but that if a linear model has been fitted with na.action = na.exclude, suitable values are filled in for the cases excluded during fitting.
请注意,weights == 0被丢弃所有这些功能,但情况下,如果已安装na.action = na.exclude,在装修过程中排除的情况下为合适的值充满线性模型。
The function hat() exists mainly for S (version 2) compatibility; we recommend using hatvalues() instead.
函数hat()存在,主要是为S(第2版)的兼容性,我们建议使用hatvalues()代替。
注意----------Note----------
For hatvalues, dfbeta, and dfbetas, the method for linear models also works for generalized linear models.
hatvalues,dfbeta,dfbetas,线性模型的方法也适用于广义线性模型。
作者(S)----------Author(s)----------
Several R core team members and John Fox, originally in his ‘<span class="file">car</span>’
package.
参考文献----------References----------
Regression Diagnostics. New York: Wiley.
Residuals and Influence in Regression. London: Chapman and Hall.
Generalized linear model diagnostics using the deviance and single case deletions. Applied Statistics 36, 181–191.
Applied Regression, Linear Models, and Related Methods. Sage.
An R and S-Plus Companion to Applied Regression. Sage Publ.; http://www.socsci.mcmaster.ca/jfox/Books/Companion/.
参见----------See Also----------
influence (containing lm.influence).
influence(含lm.influence)。
"plotmath" for the use of hat in plot annotation.
plotmath为hat图注解的使用。
举例----------Examples----------
require(graphics)
## Analysis of the life-cycle savings data[#生命周期储蓄数据的分析]
## given in Belsley, Kuh and Welsch.[#给予Belsley山和韦尔施。]
lm.SR <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
inflm.SR <- influence.measures(lm.SR)
which(apply(inflm.SR$is.inf, 1, any))
# which observations 'are' influential[意见“是”影响力]
summary(inflm.SR) # only these[只有这些]
inflm.SR # all[所有]
plot(rstudent(lm.SR) ~ hatvalues(lm.SR)) # recommended by some[建议由一些]
## The 'infl' argument is not needed, but avoids recomputation:[#INFL的说法是没有必要,但避免了重新计算:]
rs <- rstandard(lm.SR)
iflSR <- influence(lm.SR)
identical(rs, rstandard(lm.SR, infl = iflSR))
## to "see" the larger values:[#“看到”更大的价值:]
1000 * round(dfbetas(lm.SR, infl = iflSR), 3)
## Huber's data [Atkinson 1985][Huber的数据[阿特金森1985]]
xh <- c(-4:0, 10)
yh <- c(2.48, .73, -.04, -1.44, -1.32, 0)
summary(lmH <- lm(yh ~ xh))
(im <- influence.measures(lmH))
plot(xh,yh, main = "Huber's data: L.S. line and influential obs.")
abline(lmH); points(xh[im$is.inf], yh[im$is.inf], pch=20, col=2)
## Irwin's data [Williams 1987][#欧文的数据[威廉姆斯1987]]
xi <- 1:5
yi <- c(0,2,14,19,30) # number of mice responding to dose xi[数小鼠剂量第十一]
mi <- rep(40, 5) # number of mice exposed[暴露小鼠的数量]
summary(lmI <- glm(cbind(yi, mi -yi) ~ xi, family = binomial))
signif(cooks.distance(lmI), 3)# ~= Ci in Table 3, p.184[〜=词表3,p.184]
(imI <- influence.measures(lmI))
stopifnot(all.equal(imI$infmat[,"cook.d"],
cooks.distance(lmI)))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|