[R-sig-ME] Calculating fixed effect contrasts with log-transformed data

Ben Bolker bbolker at gmail.com
Wed Jul 18 00:08:07 CEST 2012


Gus Jespersen <jesper <at> u.washington.edu> writes:

> 
> Thank you Thierry,
> I have looked through the glht function in multcomp, and have two
> further questions:
> 

 [snip]

> Yet I get the following error message:
> 
> Error in parse(text = ex[i]) : <text>:1:20: unexpected symbol
> 1: sitettMossAddition Treatment
>                                        ^
> Any ideas on what I'm doing wrong here?

  It is very likely that the glht function is having trouble
with the spaces in your level names.  I would strongly suggest
that you reformulate them as legal R variable names: something like

     levels(mydata$myfactor) <- make.names(levels(mydata$myfactor))
should work.

> 
> (2) As you can see, I am working with a log10 transformed response
> variable.  I'd like to stay with this for homog. of variance reasons,
> and for reporting the "Treatment -Control" CI previously mentioned,
> I'd like to report the backtransformed limits of the CI.  At what
> point in this process should the back-transformation happen?  When
> attempting this calculation without glht, I am uncertain of where in
> the process to back-transform as well.  I had been hoping to simply
> use 10^ for each fixed effect and its SE, as well as each element of
> the vcov matrix, but I fear I am overlooking some basic math here.

  Yes, you are.  You need to back-transform the confidence intervals,
not the elements and their standard errors.  The basic math you
are thinking about is

  10^(est+1.96*stderr) !== 10^est+10^(1.96*stderr)

If you back-transform first, the RHS is what you will be doing;
you want the LHS (this is for the upper CI, the obvious parallel
applies for the lower CI)



More information about the R-sig-mixed-models mailing list