[R-sig-ME] Gamma transformation
Chris Howden
chris at trickysolutions.com.au
Thu Sep 29 04:40:19 CEST 2011
And perhaps a glmm fit with a family different to the normal distribution to
model the residuals would help? If you've got count data maybe try the
poisson.
Chris Howden B.Sc. (Hons) GStat.
Founding Partner
Tricky Solutions
Tricky Solutions 4 Tricky Problems
Evidence Based Strategic Development, IP Commercialisation and Innovation,
Data Analysis, Modelling and Training
(mobile) 0410 689 945
(fax) +612 4782 9023
chris at trickysolutions.com.au
Disclaimer: The information in this email and any attachments to it are
confidential and may contain legally privileged information. If you are not
the named or intended recipient, please delete this communication and
contact us immediately. Please note you are not authorised to copy, use or
disclose this communication or any attachments without our consent. Although
this email has been checked by anti-virus software, there is a risk that
email messages may be corrupted or infected by viruses or other
interferences. No responsibility is accepted for such interference. Unless
expressly stated, the views of the writer are not those of the company.
Tricky Solutions always does our best to provide accurate forecasts and
analyses based on the data supplied, however it is possible that some
important predictors were not included in the data sent to us. Information
provided by us should not be solely relied upon when making decisions and
clients should use their own judgement.
-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org
[mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Ben Bolker
Sent: Thursday, 29 September 2011 7:47 AM
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Gamma transformation
Iker Vaquero Alba <karraspito at ...> writes:
>
>
> Dear list:
>
> After implementing a model, I tested it for homocedasticity,
> and I was not actually very happy, as the
> variance seems to increase for higher values, according to
> the fitted values vs. residuals plot
> (attached - "Unmodified"). I tried to log-transform the
> response variable, but the result was similar.
> After looking for possible transformations of the response variable,
> I found that "gamma(x)" worked
> really well, and stabilized the variance of the model for all
> the range when plotting the fitted values vs
> residuals (attached - "Gamma").
I won't say it's impossible, and maybe someone will chime in,
but transforming by the gamma distribution seems pretty weird to me.
Power transformations are much more common. If gamma-transforming
does work, though, it is consistent with log transformation not
being satisfactory, because the gamma is *accelerating* for x>1,
while the log is monotonically *decelerating* -- it suggests that
if you are going to use a power transformation you should use
x^b with b > 1 ...
>
> I am happy with that, but it's just that I would like to make
> sure wether this is a correct step, and if it's
> possible, know what is the reason why this happens when
> applying that transformation. I am not an expert
> but I would really like to try to learn something more about
> this. I have tried to find some information in
> the web, but I'm not very happy with it. Obviously, only if
> you have the time and the willingness to explain
> it, or help me find some information about it.
> I appreciate it very much in any case.
A few things to think about:
1. boxcox() (in MASS) and powerTransform (in car) don't work with
lme-type objects, but they would work on a simpler lm-approximation
of your model (either leaving out the random effects or treating
them as fixed), and should give you at least a rough idea of the
appropriate transformation.
2. you can also try using a varStruct (e.g.
weights=varPower() ; by default this will fit
a model with the residuals proportional to
a power of the fitted value)
Ben Bolker
>
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list