I have a mixed model with three factors: one categorical and two continuous. When trying to plot the fitted lines over the original data, it passes much far below. Why would that happen? Here is the model output:
Linear mixed-effects model fit by maximum likelihood
Data: x
AIC BIC logLik
143.5392 155.3614 -64.76961
Random effects:
Formula: ~1 | col
(Intercept) Residual
StdDev: 2.737332e-05 1.221771
Fixed effects: ctmax ~ ur * hl + ratectmax
Value Std.Error DF t-value p-value
(Intercept) 23.855561 2.868299 31 8.316971 0.0000
urhigh 8.717054 4.542828 31 1.918861 0.0642
hl 0.125498 0.035472 31 3.537982 0.0013
ratectmax 7.283523 2.284297 31 3.188518 0.0033
urhigh:hl -0.080326 0.049294 31 -1.629521 0.1133
Here is the script to plot:
plot(x$ctmax~x$hl,pch=24,bg=c("light grey","purple","transparent","red","yellow")[x$col],
ylim=c(20,48), family = "Times", cex.lab = ".85", cex.axis = ".85", xlab="heating rate (°C/min)", ylab="Temperature (°C)", family = "Times")
abline(23.85, 0.12,col="black",lwd=1.8)
This method also plots nothing, despite it worked perfectly for a model with two continous factors only.
lines(predict(m7), col="black", lwd=1, lty=1)