model.extract(stats)
model.extract()所属R语言包:stats
Extract Components from a Model Frame
从模型框架中提取组件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Returns the response, offset, subset, weights or other special components of a model frame passed as optional arguments to model.frame.
返回响应,偏移,子集,通过重量或其他特殊元件的模型框架作为model.frame可选参数。
用法----------Usage----------
model.extract(frame, component)
model.offset(x)
model.response(data, type = "any")
model.weights(x)
参数----------Arguments----------
参数:frame, x, data
A model frame.
一个模型框架。
参数:component
literal character string or name. The name of a component to extract, such as "weights", "subset".
文字字符串或名称。组件的名称,如"weights","subset",提取。
参数:type
One of "any", "numeric", "double". Using either of latter two coerces the result to have storage mode "double".
一个"any","numeric","double"。使用后两种胁迫的结果有存储模式"double"。
Details
详情----------Details----------
model.extract is provided for compatibility with S, which does not have the more specific functions. It is also useful to extract e.g. the etastart and mustart components of a glm fit.
model.extract提供与S的兼容性,不会有更具体的功能。它也是有用的提取,例如etastart和mustart成分glm适合。
model.offset and model.response are equivalent to model.extract(, "offset") and model.extract(, "response") respectively. model.offset sums any terms specified by offset terms in the formula or by offset arguments in the call producing the model frame: it does check that the offset is numeric.
model.offset和model.response等于model.extract(, "offset")和model.extract(, "response")分别。 model.offsetoffset公式中的条款或offset在生产模型框架调用的参数中指定的任何条款求和:它检查,偏移是数字。
model.weights is slightly different from model.frame(, "weights") in not naming the vector it returns.
model.weights是model.frame(, "weights")未命名的向量,它返回略有不同。
值----------Value----------
The specified component of the model frame, usually a vector.
模型框架指定的组件,通常是一个向量。
参见----------See Also----------
model.frame, offset
model.frame,offset
举例----------Examples----------
a <- model.frame(cbind(ncases,ncontrols) ~ agegp+tobgp+alcgp, data=esoph)
model.extract(a, "response")
stopifnot(model.extract(a, "response") == model.response(a))
a <- model.frame(ncases/(ncases+ncontrols) ~ agegp+tobgp+alcgp,
data = esoph, weights = ncases+ncontrols)
model.response(a)
model.extract(a, "weights")
a <- model.frame(cbind(ncases,ncontrols) ~ agegp,
something = tobgp, data = esoph)
names(a)
stopifnot(model.extract(a, "something") == esoph$tobgp)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|