预测圆形参考方程的系统

时间:2018-10-16 14:02:31

标签: r linear-regression

如果我有数据框x

x = data.frame(y1 = c(1, 5, 8, 9, 10, 0, NA), 
               y2 = c(2, 6, 9, 0, 1, 7, NA), 
               x1 = c(3, 5, -8, 2, 5, 11, 12), 
               x2 = c(0, 1, 2, 8, 0, 1, 12), 
               x3 = 1:7)

并且发现y1的最佳回归依赖于y2,反之亦然,使得:

fit1 = lm(y1 ~ y2 + x1, data = x[1:6, ])
fit2 = lm(y2 ~ y1 + x2 + x3, data = x[1:6, ])

如何为第七次观测得出y1y2的预测?

0 个答案:

没有答案