作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是 Mixed Effects Models in S and S-Plus 的摘录页238 :
这是我用来重新创建此示例的代码:
library(nlme)
spatDat <- data.frame(x = c(0,0.25,0.5,0.75,1), y = c(0,0.25,0.5,0.50,0.75))
cs1Exp <- corExp(1, form = ~x+y)
cs1Exp <- initialize(cs1Exp, spatDat)
Error in getClass(Class) :
c("\"corExp\" is not a defined class", "\"corSpatial\" is not a defined class", "\"corStruct\" is not a defined class")
In addition: Warning message:
In if (!is.na(match(Class, .BasicClasses))) return(newBasic(Class, :
the condition has length > 1 and only the first element will be used
R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-linux-gnu (64-bit)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] nlme_3.1-101
loaded via a namespace (and not attached):
[1] grid_2.13.0 lattice_0.19-26
最佳答案
原因是 Initialize
拿资本I
在 nlme
所以它不会与 initialize
混淆在 base
.然后是 Vivi 对 spatdat$y
的评论
这有效:
> library(nlme)
> spatDat <- data.frame(x = c(0,0.25,0.5,0.75,1), y = c(0,0.25,0.50,0.75,1.0))
> cs1Exp <- corExp( 1, form = ~x+y )
> cs1Exp <- Initialize( cs1Exp, spatDat )
> corMatrix( cs1Exp )
[,1] [,2] [,3] [,4] [,5]
[1,] 1.0000000 0.7021885 0.4930687 0.3462272 0.2431167
[2,] 0.7021885 1.0000000 0.7021885 0.4930687 0.3462272
[3,] 0.4930687 0.7021885 1.0000000 0.7021885 0.4930687
[4,] 0.3462272 0.4930687 0.7021885 1.0000000 0.7021885
[5,] 0.2431167 0.3462272 0.4930687 0.7021885 1.0000000
关于r - 为什么在尝试对自相关建模时会出现错误,即使完全遵循 Pinheiro 和 Bates (2009) 中的这个示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6024223/
我的持续问题(参见 here 和 here)使 Pinheiro 和 Bates 的第 8 章中的非线性混合效应模型收敛。这次使用 Quinidine 数据集(第 385 页)。这又是一个迭代的模型构
这是 Mixed Effects Models in S and S-Plus 的摘录页238 : 这是我用来重新创建此示例的代码: library(nlme) spatDat 1 and only
我是一名优秀的程序员,十分优秀!