segmented(segmented)
segmented()所属R语言包:segmented
Segmented relationships in regression models
分段回归模型中的关系
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Fits regression models with segmented relationships between the response and one or more explanatory variables. Break-point estimates are provided.
适合与分段之间的关系的响应和一个或多个解释变量的回归模型。突破点估计。
用法----------Usage----------
segmented(obj, seg.Z, psi, control = seg.control(),
model = TRUE, ...)
## S3 method for class 'lm'
segmented(obj, seg.Z, psi, control = seg.control(),
model = TRUE, ...)
## S3 method for class 'glm'
segmented(obj, seg.Z, psi, control = seg.control(),
model = TRUE, ...)
参数----------Arguments----------
参数:obj
standard "linear" model of class "lm" or "glm".
类“lm”或“GLM”标准“线性”模式。
参数:seg.Z
a formula with no response variable, such as seg.Z=~x1+x2, indicating the (continuous) explanatory variables having segmented relationships with the response. Currently, formulas involving functions, such as seg.Z=~log(x1) or seg.Z=~sqrt(x1), or selection operators, such as seg.Z=~d[,"x1"] or seg.Z=~d$x1, are not allowed.
没有响应变量的公式,如seg.Z=~x1+x2,说明(连续)解释变量具有分段的响应关系。目前,公式涉及的功能,如seg.Z=~log(x1)或seg.Z=~sqrt(x1),或选择运营商,如seg.Z=~d[,"x1"]或seg.Z=~d$x1,不允许的。
参数:psi
named list of vectors. The names have to match the variables of the seg.Z argument. Each vector includes starting values for the break-point(s) for the corresponding variable in seg.Z. If seg.Z includes only a variable, psi may be a numeric vector. A NA value means that 'K' quantiles are used as starting values, where K is fixed via the seg.control auxiliary function.
命名的向量列表。的名称必须符合seg.Z参数的变量。每个向量包括的起始值的突破点(s)为相应的变量在seg.Z。 seg.Z如果只包含一个变量,psi可能是一个数值向量。 ANA这个值意味着K位数作为初始值,其中K固定通过seg.control辅助功能。
参数:control
a list of parameters for controlling the fitting process. See the documentation for seg.control for details.
的参数,用于控制的嵌合过程的列表。为seg.control的详细信息,请参阅文档。
参数:model
logical value indicating if the model.frame should be returned.
逻辑值如果应退还的model.frame,。
参数:...
optional arguments.
可选参数。
Details
详细信息----------Details----------
Given a linear regression model (of class "lm" or "glm"), segmented tries to estimate a new model having broken-line relationships with the variables specified in seg.Z. A segmented (or broken-line) relationship is defined by the slope parameters and the break-points where the linear relation changes. The number of breakpoints of each segmented relationship is fixed via the psi argument, where initial values for the break-points must be specified. The model is estimated simultaneously yielding point estimates and relevant approximate standard errors of all the model parameters, including the break-points.
线性回归模型(类“lm”或“GLM”),分段估计的新模式的尝试在seg.Z.指定的变量有虚线的关系分段(或虚线)的关系所定义的斜率参数和断裂点的线性关系变化。通过psi参数,其中指定的断裂点的初始值必须在每个分段的关系的断点的数目是固定的。该模型是同时产生的点估计及相关的所有模型参数,包括破发点的近似的标准误估计。
Since version 0.2-9.0 segmented implements the bootstrap restarting algorithm described in Wood. The bootstrap restarting is expected to escape the local optima of the objective function when the segmented relationship is flat and the log likelihood can have multiple local optima.
由于版本0.2-9.0 segmented实现木材中的引导重启描述的算法。重新启动自举逃离局部最优分割的关系是平的目标函数和对数似然可以有多个局部最优。
值----------Value----------
The returned object depends on the last component returned by seg.control. If last=TRUE, the default, segmented returns an object of class "segmented" which inherits from the class "lm" or "glm" depending on the class of obj. Otherwise a list is returned, where the last component is the fitted model at the final iteration, see seg.control. <br>
返回的对象上lastseg.control返回的组件。如果最后= TRUE,则默认情况下,分段将返回一个对象类“分段”,它继承自类“lm”或“GLM”根据obj的类。否则返回一个列表,其中的最后一个组件是在最后一次迭代拟合模型,请参阅seg.control。参考
An object of class "segmented" is a list containing the components of the original object obj with additionally the followings:
“分段的”类的一个对象是一个列表,其中包含的原始对象的组件obj与追加如下:
参数:psi
estimated break-points and relevant (approximate) standard errors
估计突破点和相关的标准误差(大约)
参数:it
number of iterations employed
雇用的迭代的数量
参数:epsilon
difference in the objective function when the algorithm stops
差异在目标函数中,该算法停止时
参数:model
the model frame
模型框架
参数:psi.history
A list or a vector including the breakpoint estimates at each step
一个列表或一个矢量,包括断点估计的每一步
Other components are not of direct interest of the user.
其它组件上没有直接利害关系的用户。
警告---------- Warning ----------
It is well-known that the log-likelihood function for the break-point may be not concave, especially for poor clear-cut kink-relationships. In these circumstances the initial guess for the break-point, i.e. the psi argument, must be provided with care. For instance visual inspection of a, possibly smoothed, scatter-plot is usually a good way to obtain some idea on breakpoint location. Moreover it is also advisable to look at the coefficients of the "gap" variables. At the convergence they should be small or at least, non-significantly different from zero. summary.segmented and print.summary.segmented return information of the "gap" coefficients. The bootstrap restarting option is to deal with poor clear cut relationships.
这是众所周知,对数似然函数的突破点可能是不凹,尤其是对贫困鲜明的扭结关系。在这种情况下,初始猜测的突破点,即psi参数,必须提供照顾。例如目视检查的,可能是平滑的,散点图通常是一个很好的方法来获得一些想法断点位置。此外,它是最好看的“缺口”变量的系数。在汇聚,它们应该是小的,或至少不显着不同于零。 summary.segmented和print.summary.segmented返回信息的“缺口”系数。引导重新启动选项是处理贫困的明确关系。
注意----------Note----------
The algorithm will start if the it.max argument returned by seg.control is greater than zero. If it.max=0 segmented will estimate a new linear model with break-point(s) fixed at the values reported in psi.
如果it.max参数返回seg.control是大于零,该算法将启动。如果it.max=0segmented将估计的一个新的突破点(S)固定在报告的值在psi线性模型。
In the returned object, the name of the difference-in-slopes parameter is labelled with "U.nameOfVariable".
返回的对象中,被标记的名称的差异在斜坡参数与U.nameOfVariable。
Methods specific to the class "segmented" are
类"segmented"具体的方法。
print.segmented
print.segmented
summary.segmented
summary.segmented
print.summary.segmented
print.summary.segmented
plot.segmented
plot.segmented
lines.segmented
lines.segmented
confint.segmented
confint.segmented
vcov.segmented
vcov.segmented
Others are inherited from the class "lm" or "glm" depending on the class of obj.
其他人都继承自类"lm"或"glm"之类的obj。
(作者)----------Author(s)----------
Vito M. R. Muggeo, <a href="mailto:vito.muggeo@unipa.it">vito.muggeo@unipa.it</a>
参考文献----------References----------
break-points. Statistics in Medicine 22, 3055–3071.
models with broken-line relationships. R News 8/1, 20–25.
参见----------See Also----------
lm, glm
lm,glm
实例----------Examples----------
set.seed(12)
xx<-1:100
zz<-runif(100)
yy<-2+1.5*pmax(xx-35,0)-1.5*pmax(xx-70,0)+15*pmax(zz-.5,0)+rnorm(100,0,2)
dati<-data.frame(x=xx,y=yy,z=zz)
out.lm<-lm(y~x,data=dati)
o<-segmented(out.lm,seg.Z=~x,psi=list(x=c(30,60)),
control=seg.control(display=FALSE))
slope(o)
out.lm<-lm(y~z,data=dati)
o1<-update(o,seg.Z=~x+z,psi=list(x=c(30,60),z=.3))
#automatic procedure to estimate breakpoints in the covariate x[估计于协变量x的断点自动程序]
# Notice: bootstrap restart is not allowed![注意:引导重启是不允许的!]
o<-segmented.lm(out.lm,seg.Z=~x+z,psi=list(x=NA,z=.3),
control=seg.control(stop.if.error=FALSE,n.boot=0))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|