qme(truncSP)
qme()所属R语言包:truncSP
Estimation of truncated regression models using the Quadratic Mode Estimator (QME)
截断回归模型估计的二次模式估计(QME)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Estimation of linear regression models with truncated response variables (fixed truncation point), using the Quadratic Mode Estimator (QME) (Lee 1993 and Laitila 2001)
估计线性回归模型的截断响应变量(固定截断点),利用二次模式(QME)(李1993年和Laitila 2001年的估计)
用法----------Usage----------
qme(formula, data, point = 0, direction = "left", cval = "ols",
const = 1, beta = "ols", covar = FALSE, na.action, ...)
## S4 method for signature 'qme'
print(x, digits = max(3, getOption("digits") - 2),
width= getOption("width"), ...)
## S4 method for signature 'qme'
summary(object, level=0.95, ...)
## S4 method for signature 'summary.qme'
print(x, digits= max(3, getOption("digits") - 2),
width= getOption("width"), ...)
## S4 method for signature 'qme'
coef(object,...)
## S4 method for signature 'qme'
vcov(object,...)
## S4 method for signature 'qme'
residuals(object,...)
## S4 method for signature 'qme'
fitted(object,...)
参数----------Arguments----------
参数:x, object
an object of class "qme"
一个对象的类"qme"
参数: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"
参数:cval
the threshold value to be used when trimming the conditional density of the errors. 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 by setting cval to be equal to a number or numeric vector of length one.
时所使用的阈值的修整错误的条件密度。默认值是"ols"的,这意味着剩余标准差拟合的线性模型,使用lm使用。方法"ml"使用截断回归模型的最大似然估计剩余标准差,,安装使用truncreg。另外,也可以手工提供通过设置cval等于为数字或数字的矢量长度为一阈值。
参数:const
the number by which to multiply the threshold value, if cval="ols" or "ml". const=0.5 would mean that half the estimated standard deviation is used as threshold. The default value is 1.
的数目乘以该阈值,如果cval="ols"或"ml"。 const=0.5将意味着,一半的估计的标准偏差作为阈值使用。默认值是1。
参数: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, as described in Karlsson (2004). 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的协方差矩阵估计使用自举,卡尔森(2004年)中描述的。默认的重复数为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.qme. A number between 0 and 1. The default value is 0.95.
所需的置信水平,置信区间提供summary.qme。 0和1之间的一个数字。默认值是0.95。
参数:...
additional arguments. For qme 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().
其他参数。对于qme的数目自举复制可以通过调节设置R=所需数量的复制。此外,controloptim参数可以通过control=list()。
Details
详细信息----------Details----------
Finds the QME estimates of the regression coefficients by maximizing the objective function described in Lee (1993) wrt the vector of regression coefficients. The maximization is performed by optim using the "Nelder–Mead" method. The maximum number of iterations is set at 2000, but this can be adjusted by setting control=list(maxit=...) (see the ...–argument). <br><br> The starting values of the regression coefficients can have a great impact on the result of the maximization. For this reason it is recommended to use one of the methods for generating these rather than supplying the values manually, unless one is confident that one has a good idea of what the starting values should be.
查找QME的回归系数的估计,李(1993年)中描述的目标函数相对于向量回归系数最大化。最大化optim使用“内尔德酒”的方法进行。最大迭代次数为2000,但可以调整设置control=list(maxit=...)(见参数)。参考参考值的回归系数可以最大化的结果有很大的影响。出于这个原因,它是推荐使用的一种方法,用于生成这些,而不是手动供给的值,除非一个是确信一个有一个好主意的初始值应该是什么。
值----------Value----------
qme returns an object of class "qme". <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 qme<br><br> An object of class "qme", 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>cval </td> <td> the threshold value used</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–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>
qme返回一个对象类"qme"。参考参考的功能summary打印结果的摘要,包括两种类型的置信区间(正常逼近和百分位数法)。一般的访问功能coef,fitted,residuals和vcov提取各种有用的功能qme的<BR> <BR>的对象返回的值类"qme"“的元素的列表:<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> cval </ TD> <TD>使用的阈值</ TD> </ TR> <tr valign="top"> <TD> X> </ TD> <TD> value </ TD> </ TR> <tr valign="top"> <TD>coefficients</ TD对应的目标函数值的> <TD>的迭代使用counts 。请参阅文档optim的进一步详情</ TD> </ TR> <tr valign="top"> <TD> optim</ TD> <TD>convergence 。的整数代码。 0表示成功完成。可能出现的错误代码是参考1表明,迭代限制的麦克斯特已经达到。参考10表示内尔德Mead单纯的退化。</ TD> </ TR> <tr valign="top"> <TD> optim</ TD> <TD>message 。一个字符的字符串,给出了优化,或optim。</ TD> </ TR> <tr valign="top"> <TD>NULL</ TD> <TD>的任何附加的信息该模型的残差</ TD> </ TR> <tr valign="top"> <TD>residuals </ TD> <TD>的拟合值</ TD> </ TR> <TR VALIGN =“”> <TD>fitted.values </ TD> <TD>的剩余自由度</ TD> </ TR> <tr valign="top"> <TD>df.residual <TD>匹配的呼叫/ TD> </ TD> </ TR> <tr valign="top"> <TD> call </ TD> <TD>如果covariance “covar =,估计协方差矩阵</ TD> </ TR> <tr valign="top"> <TD> TRUE </ TD> <TD>如果bootrepl “covar“=,引导复制</ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Anita Lindmark and Maria Karlsson
参考文献----------References----------
Karlsson, M. (2004) Finite sample properties of the QME, Communications in Statistics - Simulation and Computation, 5, pp 567–583<br><br> Laitila, T. (2001) Properties of the QME under asymmetrically distributed disturbances, Statistics & Probability Letters, 52, pp 347–352<br><br> Lee, M. (1993) Quadratic mode regression, Journal of Econometrics, 57, pp 1-19<br><br> Lee, M. & Kim, H. (1998) Semiparametric econometric estimators for a truncated regression model: a review with an extension, Statistica Neerlandica, 52(2), pp 200–225
参见----------See Also----------
qme.fit, the function that does the actual fitting <br><br> lt, for estimation of models with truncated response variables using the LT 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
qme.fit“的功能,它的实际拟合<BR> <BR> lt,估计截断响应变量的模型使用LT估计参考参考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 qme to consistently estimate the slope parameters[#使用的QME以一贯估计的斜率参数]
qme(y~x1+x2+x3+x4+x5, dtrunc, point=0, direction="left", cval="ols", const=1,
beta="ols", covar=FALSE)
##Example using data "PM10trunc"[#示例使用数据“PM10trunc”]
data(PM10trunc)
qmepm10 <- qme(PM10~cars+temp+wind.speed+temp.diff+wind.dir+hour+day,
data=PM10trunc, point=2, control=list(maxit=4500))
summary(qmepm10)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|