3:50 PM
There is an interesting question about how to use predict() function if there are polynomials terms in the lm() model and one wants to "average" over them: stats.stackexchange.com/questions/221161 I posted an answer there, that explains (I believe) what is wrong with the OP's approach, but I don't know what's the best way to handle this (how does it work in the effects package, e.g.). Would appreciate any further insights/answers. Probably @Glen_b or @gung will know this?
5 hours later…
8:49 PM
9:51 PM
Hi @Glen_b I think if you look at the question, it will become clearer. I don't think I formulated it very well here - partly because I am probably missing some standard terminology
It's unfortunate that this question is formulated with an lmer example. Everything there applies exactly the same to lm too.
Basically, the issue is very simple: imagine you have a model lm(Y~X+Z+I(Z^2)) and you want to predict Y for various X
It's like lsmeans or like what effects packages does (as far as I understand it): we should average over Z and compute the predicted Y|X
If there is no quadratic term, one can just plug mean(Z). The question is what to do when there is a a quadratic term. Or more generally, any polynomials terms of Z and maybe also of other variables etc.
10:42 PM
« first day (2255 days earlier) ← previous day next day → last day (2756 days later) »