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

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

[复制链接]
发表于 2012-9-27 22:09:16 | 显示全部楼层 |阅读模式
glmrob(robustbase)
glmrob()所属R语言包:robustbase

                                        Robust Fitting of Generalized Linear Models
                                         广义线性模型的鲁棒配件

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

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

glmrob is used to fit generalized linear models by robust methods.  The models are specified by giving a symbolic description of the linear predictor and a description of the error distribution. Currently, robust methods are implemented for family =   binomial,   = poisson,  = Gamma and  = gaussian.
glmrob来拟合广义线性模型的鲁棒性的方法。该模型被指定提供的线性预测和描述的误差分布的符号描述。目前,稳健的方法来实现family =   binomial, = poisson, = Gamma和 = gaussian。


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


glmrob(formula, family, data, weights, subset, na.action,
       start = NULL, offset, method = "Mqle",
       weights.on.x = c("none", "hat", "robCov", "covMcd"), control = NULL,
       model = TRUE, x = FALSE, y = TRUE, contrasts = NULL, trace = FALSE, ...)



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

参数:formula
a formula, i.e., a symbolic description of the model to be fit (cf. glm or lm).
formula,即是一个象征性的描述模型拟合(参见glm或lm)。


参数:family
a description of the error distribution and link function to be used in the model.  This can be a character string naming a family function, a family function or the result of a call to a family function.  (See family for details of family functions.)
在模型中使用的误差分布的描述和链接功能。这可以是一个字符串,命名家庭功能,家庭function或家庭函数的调用的结果。 (见family家庭功能的详细信息。)


参数:data
an optional data frame containing the variables in the model.  If not found in data, the variables are taken from environment(formula), typically the environment from which glmrob is called.
一个可选的数据框包含在模型中的变量。如果没有找到data,变量environment(formula),通常是glmrob被称为环境。


参数:weights
an optional vector of weights to be used in the fitting process.
在嵌合过程中要使用可选的权重向量。


参数:subset
an optional vector specifying a subset of observations to be used in the fitting process.
一个可选的矢量指定的装配过程中可以使用的观测值的一个子集。


参数:na.action
a function which indicates what should happen when the data contain NAs.  The default is set by the na.action setting in options. The “factory-fresh” default is na.omit.
一个函数,它表示当数据包含NA的,应该发生什么。默认设置是由na.actionoptions。 “出厂时的默认是na.omit。


参数:start
starting values for the parameters in the linear predictor.
线性预测器中的参数的初始值。


参数:offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting.
这可以被用来指定一个先验已知的组件被包括在配合期间的线性预测。


参数:method
a character string specifying the robust fitting method. The details of method specification are given below.  
一个字符串,指定了强大的拟合方法。方法规范的细节在下面给出。


参数:weights.on.x
character string (can be abbreviated) specifying how points (potential outliers) in x-space are downweighted.  If "hat", weights on the design of the form &radic;{1-h_{ii}} are used, where h_{ii} are the diagonal elements of the hat matrix.  If "robCov", weights based on the robust Mahalanobis distance of the design matrix (intercept excluded) are used where the covariance matrix and the centre is estimated by cov.rob from the package MASS.<br> Similarly,  if "covMcd", robust weights are computed using covMcd.  The default is "none".
字符串(可略)指定如何在X-Space的downweighted点(潜在的异常值)。如果"hat",权重的设计上的形式&radic;{1-h_{ii}}使用,其中h_{ii}的帽子矩阵的对角线元素。如果"robCov",权重的基础上设计矩阵的健壮的Mahalanobis距离(截距排除)cov.rob从包MASS。<使用估计的协方差矩阵和中心同样,如果"covMcd",强大的权重计算covMcd。默认的"none"。


参数:control
a list of parameters for controlling the fitting process. See the documentation for glmrobMqle.control for details.
的参数,用于控制的嵌合过程的列表。为glmrobMqle.control的详细信息,请参阅文档。


参数:model
a logical value indicating whether model frame should be included as a component of the returned value.
一个逻辑值,该值指示是否模型框架应包括返回值的一个组成部分。


参数:x, y
logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value.
组件的返回值的形式返回逻辑值指示是否在装修过程中的响应向量模型矩阵。


参数:contrasts
an optional list. See the contrasts.arg of model.matrix.default.
可选列表。请参阅contrasts.argmodel.matrix.default。


参数:trace
logical (or integer) indicating if intermediate results should be printed; defaults to FALSE.
逻辑(或整数)表示,如果中间结果应印有默认为FALSE。


参数:...
arguments passed to glmrobMqle.control when control is NULL (as per default).
参数传递给glmrobMqle.controlcontrol是NULL(根据默认的)。


Details

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

method="Mqle" fits a generalized linear model using Mallows or Huber type robust estimators, as described in Cantoni and Ronchetti (2001) and Cantoni and Ronchetti (2006).  In contrast to the implementation described in Cantoni (2004), the pure influence algorithm is implemented. <br> Currently no other method is implemented.
method="Mqle"适合锦葵或胡贝尔稳健估计的,坎托尼和龙凯蒂(2001年)和坎托尼龙凯蒂(2006年)中描述的广义线性模型。在坎托尼(2004年)中描述的实现相比,纯影响算法实现。目前没有其他的方法来实现。

weights.on.x= "robCov" makes sense if all explanatory variables are continuous.
weights.on.x= "robCov"是有道理的,如果所有的解释变量是连续的。


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

glmrob returns an object of class "glmrob" and is also inheriting from glm. <br> The summary method, see summary.glmrob, can be used to obtain or print a summary of the results. <br> The generic accessor functions coefficients, effects, fitted.values and residuals (see residuals.glmrob) can be used to extract various useful features of the value returned by glmrob().
glmrob返回一个对象的类"glmrob"和也继承自glm。参考summary方法,请参阅summary.glmrob,可以用来获取或打印的汇总结果。参考一般的访问功能coefficients,effects,fitted.values和residuals返回(见residuals.glmrob)可用于提取各种有用的功能的价值glmrob()。

An object of class "glmrob" is a list with at least the following components:
一种的类"glmrob"的对象是与至少以下组件的列表:


参数:coefficients
a named vector of coefficients
一个命名的系数向量


参数:residuals
the working residuals, that is the (robustly &ldquo;huberized&rdquo;) residuals in the final iteration of the IWLS fit.
工作残差,即是(鲁棒“huberized”)的IWLS适合的最终迭代中残差。


参数:fitted.values
the fitted mean values, obtained by transforming the linear predictors by the inverse of the link function.
拟合的平均值,得到的由链接函数的逆变换的线性预测。


参数:w.r
robustness weights for each observations; i.e., residuals * w.r equals the psi-function of the Preason's residuals.
鲁棒性的权重为每个观察,也就是说,residuals*w.r等于PSI功能的Preason的残留物。


参数:w.x
weights used to down-weight observations based on the position of the observation in the design space.
用于观察的设计空间中的位置的基础上的重量向下观察的权重。


参数:dispersion
robust estimation of dispersion paramter if appropriate
稳健估计的分散放慢参数(如适用)


参数:cov
the estimated asymptotic covariance matrix of the estimated coefficients.
估计的渐近协方差矩阵的估计系数。


参数:tcc
the tuning constant c in Huber's psi-function.
调整常数c在Huber的PSI功能。


参数:family
the family object used.
family对象。


参数:linear.predictors
the linear fit on link scale.
的线性拟合链路上规模。


参数:deviance
NULL; Exists because of compatipility reasons.
NULL;存在因为,compatipility的原因。


参数:iter
the number of iterations used by the influence algorithm.
的影响算法所使用的迭代数量。


参数:converged
logical. Was the IWLS algorithm judged to have converged?
逻辑。是IWLS算法判断有融合?


参数:call
the matched call.
匹配的呼叫。


参数:formula
the formula supplied.
提供的公式。


参数:terms
the terms object used.
terms对象。


参数:data
the data argument.
data argument。


参数:offset
the offset vector used.
使用偏置向量。


参数:control
the value of the control argument used.
control参数的值。


参数:method
the name of the robust fitter function used.
使用鲁棒钳工功能的名称。


参数:contrasts
(where relevant) the contrasts used.
(如适用)的对比。


参数:xlevels
(where relevant) a record of the levels of the factors used in fitting.
(如适用)创纪录的水平在装修中使用的因素。


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


Andreas Ruckstuhl



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

Robust Inference for Generalized Linear Models. JASA 96 (455), 1022&ndash;1030.
Analysis of Robust Quasi-deviances for Generalized Linear Models. Journal of Statistical Software, 10, http://www.jstatsoft.org/v10/i04
A robust approach for skewed and heavy-tailed outcomes in the analysis of health care expenditures. Journal of Health Economics 25, 198&ndash;213.
Robust Methods in Biostatistics. Wiley Series in Probability and Statistics.

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

predict.glmrob for prediction; glmrobMqle.control
predict.glmrob预测; glmrobMqle.control


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


## Binomial response --------------[#二项式响应--------------]
data(carrots)

Cfit1 <- glm(cbind(success, total-success) ~ logdose + block,
             data = carrots, family = binomial)
summary(Cfit1)

Rfit1 <- glmrob(cbind(success, total-success) ~ logdose + block,
                family = binomial, data = carrots, method= "Mqle",
                control= glmrobMqle.control(tcc=1.2))
summary(Rfit1)

Rfit2 <- glmrob(success/total ~ logdose + block, weights = total,
                family = binomial, data = carrots, method= "Mqle",
                control= glmrobMqle.control(tcc=1.2))
coef(Rfit2)  ## The same as Rfit1[#一样Rfit1的]


## Binary response --------------[#二进制响应--------------]
data(vaso)

Vfit1 <- glm(Y ~ log(Volume) + log(Rate), family=binomial, data=vaso)
coef(Vfit1)

Vfit2 <- glmrob(Y ~ log(Volume) + log(Rate), family=binomial, data=vaso,
                method="Mqle", control = glmrobMqle.control(tcc=3.5))
## Note the problems with  tcc &lt;= 3 %% FIXME algorithm ???[#注意的问题与TCC <= 3%的FIXME算法??]
coef(Vfit2) # c = 3.5 ==&gt; not much different from classical[C = 3.5 ==>没有太大的不同,从古典]



## Poisson response --------------[#的泊松反应--------------]
data(epilepsy)

Efit1 <- glm(Ysum ~ Age10 + Base4*Trt, family=poisson, data=epilepsy)
summary(Efit1)

Efit2 <- glmrob(Ysum ~ Age10 + Base4*Trt, family = poisson,
                data = epilepsy, method= "Mqle",
                control = glmrobMqle.control(tcc= 1.2))
summary(Efit2)

## 'x' weighting:[#X加权:]
(Efit3 <- glmrob(Ysum ~ Age10 + Base4*Trt, family = poisson,
                 data = epilepsy, method= "Mqle", weights.on.x = "hat",
                 control = glmrobMqle.control(tcc= 1.2)))

try( # gives singular cov matrix: 'Trt' is binary factor --&gt;[覆盖矩阵给出了奇异的“泰爱泰党”是二进制的因素 - >]
     # affine equivariance and subsampling are problematic[仿射的equivariance和二次抽样是有问题的]
Efit4 <- glmrob(Ysum ~ Age10 + Base4*Trt, family = poisson,
                data = epilepsy, method= "Mqle", weights.on.x = "covMcd",
                control = glmrobMqle.control(tcc=1.2, maxit=100))
)

### -------- Gamma family -- data from example(glm) ---[##--------伽玛家庭 - 例如数据(GLM)---]

clotting <- data.frame(
            u = c(5,10,15,20,30,40,60,80,100),
         lot1 = c(118,58,42,35,27,25,21,19,18),
         lot2 = c(69,35,26,21,18,16,13,12,12))
summary(cl <- glm   (lot1 ~ log(u), data=clotting, family=Gamma))
summary(ro <- glmrob(lot1 ~ log(u), data=clotting, family=Gamma))

clotM5.high <- within(clotting, { lot1[5] <- 60 })
op <- par(mfrow=2:1, mgp = c(1.6, 0.8, 0), mar = c(3,3:1))
plot( lot1  ~ log(u), data=clotM5.high)
plot(1/lot1 ~ log(u), data=clotM5.high)
par(op)
## Obviously, there the first observation is an outlier with respect to both[#显然,第一次观测是两方面的离群]
## representations![#表示!]

cl5.high <- glm   (lot1 ~ log(u), data=clotM5.high, family=Gamma)
ro5.high <- glmrob(lot1 ~ log(u), data=clotM5.high, family=Gamma)
with(ro5.high, cbind(w.x, w.r))## the 5th obs. is downweighted heavily![#第5的OB。 downweighted严重!]

plot(1/lot1 ~ log(u), data=clotM5.high)
abline(cl5.high, lty=2, col="red")
abline(ro5.high, lwd=2, col="blue") ## result is ok (but not "perfect")[结果是确定的(而不是“完美”)]




















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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 05:58 , Processed in 0.027057 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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