Hi S-news community,
I have seen many many requests
over the last 6 years or so requesting for help with confidence intervals for the
predictions with lme, without any replies. I know
that the se.fit option is not available for predict.lme.
Therefore, one solution is to manually work out the formula
for the variance for the formula required.
Can I give you an example:
lm.3 <- lme (fev1 ~ timem + timem^2 +
timem^3 + gp + gp:timem + gp:timem^2 +gp:timem^3, data="" random =
~ timem | id, na.action=na.omit)
Where fev1 is a measure of lung
function with time (timem - months) and group (gp - surgery or not) by patient (id). It is straightforward
to plot the difference of the 2 treatments as a cubic term with time, by
plotting the coefficients of:
gp
+ gp:timem + gp:timem^2 + gp:timem^3
against time. But
how can I calculate the variance of this 4 term equation to be able to derive
the standard error? Is there an S plus function that will allow me determine
the variance / covariance matrix and what is the formula for the variance of
the 4 term equation given the variance / covariance values?
A solution to this problem, will
provide the answer and put to rest the ghosts of many previously unanswered
requests.
Kind regards,
Eric Lim
Papworth Hospital, Cambridge UK.