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

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

[复制链接]
发表于 2012-10-1 12:17:18 | 显示全部楼层 |阅读模式
lt(truncSP)
lt()所属R语言包:truncSP

                                         Estimation of truncated regression models using the Left Truncated (LT) estimator
                                         使用左截断(LT)估计的截断回归模型的估计

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

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

Estimates linear regression models with truncated response variables (fixed truncation point), using the LT estimator (Karlsson 2006).
估计线性回归模型的截断响应变量(固定截断点),使用的:LT估计(卡尔森2006年)。


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


lt(formula, data, point = 0, direction = "left", clower = "ols",
   const = 1, cupper = 2, beta = "ols", covar = FALSE, na.action, ...)
## S4 method for signature 'lt'
print(x, digits = max(3, getOption("digits") - 2),
    width= getOption("width"), ...)
## S4 method for signature 'lt'
summary(object, level=0.95, ...)
## S4 method for signature 'summary.lt'
print(x, digits= max(3, getOption("digits") - 2),
    width= getOption("width"), ...)
## S4 method for signature 'lt'
coef(object,...)
## S4 method for signature 'lt'
vcov(object,...)
## S4 method for signature 'lt'
residuals(object,...)
## S4 method for signature 'lt'
fitted(object,...)



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

参数:x, object
an object of class "lt"
一个对象的类"lt"


参数:formula
a symbolic description of the model to be estimated
以进行估计的模型的符号描述


参数:data
an optional data frame
一个可选的数据框


参数:point
the value of truncation (the default is 0)
截断值(默认是0)


参数:direction
the direction of truncation, either "left" (the default) or "right"
截断的方向,无论是"left"(默认)或"right"


参数:clower
the lower threshold value to be used when trimming the conditional density of the errors from below. The default is "ols" meaning that the residual standard deviation from fitting a linear model using lm is used. Method "ml" uses the estimated residual standard deviation from a maximum likelihood model for truncated regression, as fitted using truncreg. It is also possible to manually supply the threshold value by setting clower to be equal to a number or numeric vector of length one.
下限阈值时要使用的修整错误的条件密度从下面。默认值是"ols"的,这意味着剩余标准差拟合的线性模型,使用lm使用。方法"ml"使用截断回归模型的最大似然估计剩余标准差,,安装使用truncreg。另外,也可以手动供给通过设置clower为数字或数字的矢量长度为一等于所述阈值。


参数:const
the number by which to multiply the lower threshold value, if clower="ols" or "ml". const=0.5 would mean that half the estimated standard deviation is used as the lower threshold value. The default value is 1.
数字乘以较低的阈值,如果clower="ols"或"ml"。 const=0.5将意味着,一半的估计的标准偏差作为下限阈值。默认值是1。


参数:cupper
number indicating what upper threshold to use when trimming the conditional density of the errors from above. If clower="ols" or "ml" the number is used to multiply the lower threshold value, i.e. if cupper=2 (the default value) the upper threshold value is two times larger than the lower threshold value. If clower has been supplied manually, cupper is interpreted as the value of the upper threshold rather than the number used to multiply the lower threshold value.  
数字,表示修剪时使用的错误从上面的条件密度的上限阈值。如果clower="ols"或"ml"的数量被用于乘以较低的阈值,即如果cupper=2(默认值)的上限阈值低阈值的2倍。如果clower手动已被供给,cupper被解释为上限阈值,而不是用来乘以下限阈值的数目的值。


参数:beta
the method of determining the starting values of the regression coefficients (See Details for more information):  
的方法确定初始值的回归系数(见详细信息详细信息):

The default method is "ols", meaning that the estimated regression coefficients from fitting a linear model with lm are used.  
默认的方法是"ols",这意味着拟合的线性模型的估计回归系数lm。

Method "ml" means that the estimated regression coefficients from fitting a maximum likelihood model for truncated regression, assuming Gaussian errors, are used. The maximum likelihood model is fitted using truncreg.  
方法"ml"是指截断回归模型拟合的最大似然,假设是高斯的错误,所使用的估计回归系数。最大似然模型安装使用truncreg。

The third option is to manually provide starting values as either a vector, column matrix or row matrix.  
第三个选项是手动提供的初始值作为向量,列矩阵或行矩阵。


参数:covar
logical. Indicates whether or not the covariance matrix should be estimated. If TRUE the covariance matrix is estimated using bootstrap. The default number of replicates is 200 but this can be adjusted (see argument ...). However, since the bootstrap procedure is time-consuming the default is covar=FALSE.
逻辑。指示是否应当估计的协方差矩阵。如果TRUE的协方差矩阵估计使用自举。默认的重复数为200,但可以调整(见参数...)。然而,由于自举过程是耗时的默认是covar=FALSE。


参数:na.action
a function which indicates what should happen when the data contain NAs.
一个函数,它表示当数据包含NA的,应该发生什么。


参数:digits
the number of digits to be printed      
要打印的数字位数


参数:width
the width of the printing
的宽度的印刷


参数:level
the desired level of confidence, for confidence intervals provided by summary.lt. A number between 0 and 1. The default value is 0.95.
所需的置信水平,置信区间提供summary.lt。 0和1之间的一个数字。默认值是0.95。


参数:...
additional arguments. For lt the number of bootstrap replicates can be adjusted by setting R=the desired number of replicates. Also the control argument of optim can be set by control=list().
其他参数。对于lt的数目自举复制可以通过调节设置R=所需数量的复制。此外,controloptim参数可以通过control=list()。


Details

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

Minimizes the objective function described in Karlsson (2006) wrt the vector of regression coefficients, in order to find the LT estimates. The minimization is performed by optim using the "Nelder&ndash;Mead" method, and a maximum number of iterations of 2000. The maximum number of iterations can be adjusted by setting control=list(maxit=...) (see the ...&ndash;argument). <br><br> It is recommended to use one of the methods for generating the starting values of the regression coefficients (see argument beta) rather than supplying these manually, unless one is confident that one has a good idea of what these should be. This because the starting values can have a great impact on the result of the minimization. <br><br> Note that setting cupper=1 means that the LT estimates will coincide with the estimates from the Quadratic Mode Estimator (see function qme).
卡尔森(2006年)中描述的目标函数最小化的回归系数,相对于的矢量,以便找到的LT估计。的最小化是通过optim使用“内尔德米德法”,和2000年的最大数目的迭代。最大迭代次数可以调整通过设置control=list(maxit=...)(见参数)。参考建议使用的方法之一生成的初始值的回归系数(见参数beta)而不是提供手动,除非是有信心的,有了一个好主意,这些应该是什么。这是因为初始值可以有很大的影响最小化的结果。参考参考注意,设置cupper=1意味着LT估计将与二次模式估计的估计(见函数qme的)。


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

lt returns an object of class "lt". <br><br> The function summary prints a summary of the results, including two types of confidence intervals (normal approximation and percentile method). The generic accessor functions coef, fitted, residuals and vcov extract various useful features of the value returned by lt<br><br> An object of class "lt", a list with elements: <table summary="R valueblock"> <tr valign="top"><td>coefficients </td> <td> the named vector of coefficients</td></tr> <tr valign="top"><td>startcoef </td> <td> the starting values of the regression coefficients used by optim</td></tr> <tr valign="top"><td>cvalues </td> <td> matrix containing the threshold values used (cl=lower threshold value and cu=upper threshold value)</td></tr> <tr valign="top"><td>value </td> <td> the value of the objective function corresponding to coefficients</td></tr> <tr valign="top"><td>counts </td> <td> number of iterations used by optim. See the documentation for optim for further details</td></tr> <tr valign="top"><td>convergence </td> <td> from optim. An integer code. 0 indicates successful completion. Possible error codes are <br> 1  indicating that the iteration limit maxit had been reached.<br> 10  indicating degeneracy of the Nelder&ndash;Mead simplex.</td></tr>         <tr valign="top"><td>message </td> <td> from optim. A character string giving any additional information returned by the optimizer, or NULL.</td></tr> <tr valign="top"><td>residuals </td> <td> the residuals of the model</td></tr> <tr valign="top"><td>fitted.values </td> <td> the fitted values</td></tr> <tr valign="top"><td>df.residual </td> <td> the residual degrees of freedom</td></tr> <tr valign="top"><td>call </td> <td> the matched call</td></tr> <tr valign="top"><td>covariance </td> <td> if covar=TRUE, the estimated covariance matrix</td></tr> <tr valign="top"><td>bootrepl </td> <td> if covar=TRUE, the bootstrap replicates</td></tr> </table>
lt返回一个对象类"lt"。参考参考的功能summary打印结果的摘要,包括两种类型的置信区间(正常逼近和百分位数法)。一般的访问功能coef,fitted,residuals和vcov提取各种有用的功能lt的<BR> <BR>的对象返回的值类"lt"“的元素的列表:<table summary="R valueblock"> <tr valign="top"> <TD>coefficients  </ TD> <TD>命名的系数向量< / TD> </ TR> <tr valign="top"> <TD> startcoef </ TD> <TD>的初始值的回归系数optim</ TD> </ TR> <tr valign="top"> <TD> cvalues  </ TD> <TD>基质中含有的阈值(cl=低阈值和cu=阈值上限值)</ TD> </ TR> <tr valign="top"> <TD>value  </ TD> <TD>相应的目标函数值coefficients</ TD> </ TR> <tr valign="top"> <TD> counts </ TD> <TD>的迭代使用optim。请参阅文档optim的进一步详情</ TD> </ TR> <tr valign="top"> <TD> convergence </ TD> <TD>optim。的整数代码。 0表示成功完成。可能出现的错误代码是参考1表明,迭代限制的麦克斯特已经达到。参考10表示内尔德Mead单纯的退化。</ TD> </ TR> <tr valign="top"> <TD> message </ TD> <TD>optim。一个字符的字符串,给出了优化,或NULL。</ TD> </ TR> <tr valign="top"> <TD>residuals </ TD> <TD>的任何附加的信息该模型的残差</ TD> </ TR> <tr valign="top"> <TD>fitted.values  </ TD> <TD>的拟合值</ TD> </ TR> <TR VALIGN =“”> <TD>df.residual  </ TD> <TD>的剩余自由度</ TD> </ TR> <tr valign="top"> <TD>call  <TD>匹配的呼叫/ TD> </ TD> </ TR> <tr valign="top"> <TD> covariance  </ TD> <TD>如果covar“=  TRUE,估计协方差矩阵</ TD> </ TR> <tr valign="top"> <TD> bootrepl  </ TD> <TD>如果covar“=“TRUE,引导复制</ TD> </ TR> </ TABLE>


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



Anita Lindmark and Maria Karlsson




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

Karlsson, M. (2006) Estimators of regression parameters for truncated and censored data, Metrika, 63, pp 329&ndash;341

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

lt.fit, the function that does the actual fitting <br><br> qme, for estimation of models with truncated response variables using the QME estimator <br><br> stls, for estimation of models with truncated response variables using the STLS estimator <br><br> truncreg for estimating models with truncated response variables by maximum likelihood, assuming Gaussian errors
lt.fit“的功能的实际装修<BR> <BR>的不qme,使用的QME估计参考参考stls截断响应变量的模型估计,截断响应的的STLS估计参考参考变量的模型估计truncreg截断响应变量的模型,通过最大似然估计,假设是高斯的错误


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


##Simulate a data.frame (model with asymmetrically distributed errors)[#(非对称分布的错误的模型模拟数据框)]
n <- 10000
x1 <- runif(n,0,10)
x2 <- runif(n,0,10)
x3 <- runif(n,-5,5)
x4 <- runif(n,5,10)
x5 <- runif(n,-5,5)
eps <- rexp(n,0.2)- 5
y <- 2-2*x1+x2+2*x3+x4-x5+eps
d <- data.frame(y=y,x1=x1,x2=x2,x3=x3,x4=x4,x5=x5)


##Use a truncated subsample[#使用截断的子样本]
dtrunc <- subset(d, y>0)

##Use lt to consistently estimate the slope parameters[#使用LT一贯的斜率参数估计]
lt(y~x1+x2+x3+x4+x5, dtrunc, point=0, direction="left", clower="ols", const=1,
   cupper=2, beta="ols", covar=FALSE)
   
##Example using data "PM10trunc"[#示例使用数据“PM10trunc”]
data(PM10trunc)

ltpm10 <- lt(PM10~cars+temp+wind.speed+temp.diff+wind.dir+hour+day,
   data=PM10trunc, point=2, control=list(maxit=2500))

summary(ltpm10)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 10:36 , Processed in 0.030019 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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