Hi
I'd like to present a graph of conditional modes (BLUPs) and an estimate of their error in a paper. I can see this as being straightforward in a situation where there are no transformations in the model:

fm1 <- lmer (distance ~age * Sex + (age | Subject), Orthodont)
##extract Subject conditional modes
(subject.fm1 <- ranef(fm1)$Subject[, 1])
##extract standard errors
(subject.se.fm1 <- sqrt(attr(ranef(fm1, postVar = TRUE)[["Subject"]], "postVar")[1, 1, ]))
##or displayed as a dotplot with 95% prediction intervals
dotplot(ranef(fm2,condVar=TRUE))

##My data are a time series, so I use the following function to produce a plot of conditional modes with their SEs (not really appropriate with this dataset, but you get the idea)
CoefPlot <- function(xaxis, coefs, ses, col.line = "black",
...) {
require(plotrix)
plotCI(xaxis, coefs, ses, ...)
lines(xaxis, coefs, lty = 2, col = col.line)
}
##27 Subjects
CoefPlot(1:27, subject.fm1, subject.se.fm1,
xlab = "subject", ylab = "distance (mm)", las = 1)

What happens if the response and/or predictor variables are transformed as in fm2 below?

fm2 <- lmer (log(distance) ~ log(age) * Sex + (log(age) | Subject),Orthodont)
##extract Subject conditional modes
(subject.fm2 <- ranef(fm2)$Subject[, 1])
##extract standard errors
(subject.se.fm2 <- sqrt(attr(ranef(fm2, postVar = TRUE)[["Subject"]], "postVar")[1, 1, ]))

If I were to display fixed effects (log(Days)) from fm2 on the scale of the response, I'd back-transform fitted values using the appropriate link and inverse functions. E.g. using Effect from the effects package
library(effects)
plot(Effect(c("age","Sex"), fm2, transformation=list(link=log, inverse=exp)), ylab="distance (mm)")

Given the random Subject effects are relative to the overall model intercept, does it make sense to do something similar to the Subject random effects or should they be left as is? If yes, how, e.g. add them to the overall intercept then transform? Also, what do I do with the SEs to account for bias in back-transformation? I just think in my case it would be more consistent for the reader to present both the conditional mode and fixed effects graphs on the same y axis scale (preferably that of the response variable).

Cheers

John



	[[alternative HTML version deleted]]

