【发布时间】:2013-03-26 00:00:02
【问题描述】:
我当前的代码是这样的:
Model <- head(rollapplyr(z, width = 131, function(x)
fitted(lm(y ~x1+ x2, data = as.data.frame(x))), by.column = FALSE)[,131],3429)
我想这样做:
fit1 <- lm(y ~x1+ x2)
Model <- head(rollapplyr(z, width = 131, function(x) fitted(fit1),
data = as.data.frame(x))), by.column = FALSE)[,131],3429)
基本上,我只是想在fit1 中加入回归方程,但我不断收到错误消息。任何帮助将不胜感激。
【问题讨论】:
-
您好!请查看How to make a great reproducible example 以使您的帖子可复制,以便我们为您提供帮助。谢谢。
-
另外,请根据您遇到的错误进行编辑。