Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R误差中绘制残差_R - Fatal编程技术网

在R误差中绘制残差

在R误差中绘制残差,r,R,我试图在R中绘制拟合图,我得到以下错误: Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ 这是我的密码: exercise <- as.factor(c(10, 10, 20, 20, 10, 10, 20, 20)) time <- c("pm", "am", "am", "pm", "am", "pm", "pm", "am") glucose <- c(71.5, 10

我试图在R中绘制拟合图,我得到以下错误:

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ
这是我的密码:

exercise <- as.factor(c(10, 10, 20, 20, 10, 10, 20, 20))
time <- c("pm", "am", "am", "pm", "am", "pm", "pm", "am")
glucose <- c(71.5, 103, 83.5, 126, 125.5, 129.5, 95, 93)

fit1 <- aov(glucose ~ exercise + time)
summary(fit1)



par(mfrow = c(2, 2))
plot(fit1)

练习你需要确保时间是一个因素

time <- as.factor(c("pm", "am", "am", "pm", "am", "pm", "pm", "am"))
时间