plotting residuals in R error -
i'm trying plot fit in r , i following error:
error in xy.coords(x, y, xlabel, ylabel, log) : 'x' , 'y' lengths differ
here code:
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)
you need make sure time
factor.
time <- as.factor(c("pm", "am", "am", "pm", "am", "pm", "pm", "am"))
then plot work. looks aov
gets bit confused when pass character vector.
Comments
Post a Comment