[R] logit() etc {was "Re: glmer with non integer weights"}

Martin Maechler maechler at stat.math.ethz.ch
Mon Apr 19 13:32:18 CEST 2010


>>>>> "EC" == Emmanuel Charpentier <charpent at bacbuc.dyndns.org>
>>>>>     on Sun, 18 Apr 2010 11:29:29 +0200 writes:

    EC> Le vendredi 16 avril 2010 à 00:15 -0800, Kay Cichini a
    EC> écrit :
    >> thanks thierry,
    >> 
    >> i considered this transformations already, but variance
    >> is not stabilized and/or normality is neither achieved.
    >> i guess i'll have to look out for non-parametrics?

    EC> Or (maybe) a model based on a non-Gaussian likelihood ?
    EC> A beta distribution comes to mind, either fitted by
    EC> maximum likelihood or (if relevant prior information is
    EC> available) in a Bayesian framework ?

    EC> But beware : you have a not-so-small problem ...

    EC> Your data have zeroes and ones, which, if you have no
    EC> information on a "sample size", are "sharp" zeroes and
    EC> ones, and there therefore theoretically bound to
    EC> infinite linear predictors (in plain English : bloody
    EC> unlikely). These values make a "fixed effect" analysis
    EC> impossible : these points "at infinite" will make
    EC> regression essentially impossible. Consider :

    >> logit<-function(x)log(x/(1-x))
    >> ilogit<-function(x)1/(1+exp(-x))

Hmmm,  and some CRAN packages even define these ..

Now, please,  the help page   ?Logistic
has contained for a long time now

 >> Note:
 >> 
 >>      ‘qlogis(p)’ is the same as the well known ‘_logit_’ function,
 >>      logit(p) = log(p/(1-p), and ‘plogis(x)’ has consequently been
 >>      called the ‘inverse logit’.

So please "note", and do use qlogis() and plogis() instead of
logit() and ilogit() ... 
or if you really really must (e.g. for didactical reasons), use

logit <- qlogis

Using the logistic functions directly may also remind you or
your user that sometimes it will be advantageous to use
'log.p=TRUE' or 'lower.tail=FALSE'  ``coordinate systems"

Martin


  [...................................]
  [...................................]



More information about the R-help mailing list