[R-sig-ME] R: Re: R: Re: GLMM family=binomial, link identity

maggenga at libero.it maggenga at libero.it
Fri Mar 1 10:00:31 CET 2013


I dont'know where I take new lme4 version '0.99999911.1'

Where do I search it ?

My problem is this:


###start script

library(lme4)

packageVersion("lme4")  # ‘0.999999.0’

set.seed(101)
win=rbinom(50,20,0.6)
lost=rbinom(50,20,0.4)
x1=rbinom(50,1,0.3)


# my data (endogenous variable = matrix with "win and lost counts" for each 
row)

f <- factor(sample(LETTERS[1:26], size = 50, replace = TRUE))

m1OR <- glmer(cbind(win,lost) ~ x1 + (1 | f), family = binomial(link = 
"logit"))
summary(m1OR)
m1RD <- glmer(cbind(win,lost) ~ x1 + (1 | f), family = binomial(link = 
"identity")) # ERROR
summary(m1RD) # ERROR


# trial with endogenous = binary vector 

a=rbinom(50,1,0.3)

m2OR <- glmer(a ~ x1 + (1 | f), family = binomial(link = "logit"))
summary(m2OR)
m2RD <- glmer(a ~ x1 + (1 | f), family = binomial(link = "identity")) # ERROR
summary(m2RD) # ERROR


###end script

Thank you very much for our help and time.

Davide

>----Messaggio originale----
>Da: bbolker a gmail.com
>Data: 27/02/2013 1.55
>A: "maggenga a libero.it"<maggenga a libero.it>, "r-sig-mixed-models a r-project.
org"<r-sig-mixed-models a r-project.org>
>Ogg: Re: R: Re: [R-sig-ME] GLMM family=binomial, link identity
>
>On 13-02-26 05:57 PM, maggenga a libero.it wrote:
>> Sorry, i was wrong. I want say lme4 package.
>> 
>> 
>> But "glmer(...,family=binomial(link="identity")) " give me same results
>> 
>> as
>> 
>> "glmer(...,family=binomial(link="logit")) "
>> 
>> Why?
>> 
>> I want interpret the coefficients as risk difference and not OR
>> 
>> Thank you very much
>> 
>> Davide
>
>[cc'ing back to r-sig-mixed-models: it's best to keep these
>conversations on-list]
>
>  It's hard to say without a reproducible example
><http://tinyurl.com/reproducible-000>.  I made up an example that seemed
>to work, sort of -- at least it showed that I do *not* get the same
>results.  With the stable version of lme4, the fit worked with the
>default (logit) link and failed with the identity link (although
>apparently for reasons of numerical instability, not because it's
>impossible to fit such models).  With the development version (latest
>version from github), both worked, and the identity link results seem to
>have correctly estimated the parameters (I can tell because the data
>were simulated).
>
>See
>
>http://rpubs.com/bbolker/4671
>
>> 
>> 
>> 
>>> ----Messaggio originale----
>>> Da: bbolker a gmail.com
>>> Data: 26/02/2013 23.40
>>> A: <r-sig-mixed-models a r-project.org>
>>> Ogg: Re: [R-sig-ME] GLMM family=binomial, link identity
>>>
>>> maggenga a ... <maggenga a ...> writes:
>>>
>>>>
>>>> Hi,
>>>> I'm phd student in medical statistics.
>>>> I would like know the R-way to perform the identity link 
(family=binomial) 
>> in
>>> lmer (ade4 package).
>>>
>>>  How about
>>>
>>> glmer(...,family=binomial(link="identity")) 
>>>
>>> ?
>>>
>>> See ?family in base R.
>>>
>>> Warning: this is likely to be fragile (as fitting with non-standard
>>> link functions often is).
>>>
>>> _______________________________________________
>>> R-sig-mixed-models a 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