[英]R: Base functions cannot use object from the package Caper
I'm running a phylogenetic analysis using the caper
package, where the regression function (which uses phylogeneticaly independent contrasts) is crunch
. 我正在使用caper
包进行系统发育分析,其中的回归函数(使用系统发育独立的对比)非常crunch
。 The crunch
function uses an object internal to the caper
package called caic
. crunch
功能使用在caper
包内部的名为caic
的对象。
The model is started via: 该模型通过以下方式启动:
crunchMod <- crunch(y ~ f(x), data = comparison)
When I run summary(crunchMod)
I am given a format identical to that of a summary produced from the lm()
function. 当我运行summary(crunchMod)
时,会得到与lm()
函数生成的摘要相同的格式。
However, in an attempt to begin checking model assumptions by entering rstandard(crunchMod)
, I receive the following error: 但是,尝试通过输入rstandard(crunchMod)
开始检查模型假设时,出现以下错误:
Error in UseMethod("rstandard") :
no applicable method for 'rstandard' applied to an object of class "caic"
Reading through http://cran.r-project.org/web/packages/caper/vignettes/caper.pdf on pages 19-20, I find that plot(crunchMod)
uses a wrapper to enable the checking of regression assumptions. 通过阅读第19-20页的http://cran.r-project.org/web/packages/caper/vignettes/caper.pdf ,我发现plot(crunchMod)
使用包装器可以检查回归假设。 However, these are graphical checks for: 但是,这些是图形检查:
residuals vs Fitted values
standardized residuals vs theoretical quantities [QQ plot]
sqrt(standardized residuals) vs fitted values [Scale-location]
standardized residuals vs leverage).
Does anyone know how to access the standardized residuals using my own wrapper, or allow me to access p-values instead of the graphical images? 有谁知道如何使用我自己的包装器访问标准化残差,或者允许我访问p值而不是图形图像?
This one is pretty simple, but only after going round in circles for a while with that second if()
statement in crunch().
这是非常简单的,但只有在使用crunch().
中的第二条if()
语句绕了一圈之后才进行crunch().
Looking at the summary method for caic
, it's just a subset of the entire summary / model 查看caic
的摘要方法,它只是整个摘要/模型的一部分
> summary.caic
function (object, ...)
{
summary(object$mod, ...)
}
<environment: namespace:caper>
You can see the names of the entire model show there are useful statistics in the rest of it. 您可以看到整个模型的名称,其中显示了其余的有用统计信息。
names(summary(crunchMod))
# [1] "call" "terms" "residuals" "coefficients"
# [5] "aliased" "sigma" "df" "r.squared"
# [9] "adj.r.squared" "fstatistic" "cov.unscaled"
Note that only the mod
section inherits from lm()
You can check out all the inheritence of the crunchMod
objects with 请注意,只有mod
部分是从lm()
继承的,您可以使用以下命令检查出crunchMod
对象的所有继承
> sapply(crunchMod, is)
$contrast.data
[1] "list" "vector"
$mod
[1] "lm" "oldClass"
$data
[1] "comparative.data"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.