[R-sig-ME] glmmPQL inquiry

Ken Beath kjbeath at kagi.com
Thu Dec 6 22:23:58 CET 2007


On 07/12/2007, at 7:33 AM, kennedy otwombe wrote:

> Dear R users,
>
> I have longitudinal data that is all binary and i have run it in SAS  
> using the following code without a problem:
>
> proc glimmix data=navs;
> class id;
> model y(event='1')=x1 x2 x3/solution distribution=binary;
> random intercept/subject=id type=cs;
> run;
>
> I have also written a code in R for the same analysis but i am  
> getting the following error message (iteration 1
> Error in switch(mode(x), "NULL" = structure(NULL, class =  
> "formula"),  :
>  invalid formula).
>
> My code in R reads as follows:
>
>> fit<-glmmPQL(y~x1+x2+x3, random=~1|id, family=binomial, data=navs)
>> summary(fit)
>
> I am not sure where the problem lies but i realise that glmmPQL does  
> not seem to cater for binary distributions and i aint sure how to  
> model the probability of the event Y=1 which is my interest in the  
> data i am assuming. My data looks as follows:
>
>  t id y x0 x1 x2 x3
>  1  1 0  0  0  1  1
>  2  1 0  0  1  0  1
>  3  1 0  0  1  0  1
>  1  2 0  0  0  1  0
>  2  2 0  1  1  1  0
>  3  2 0  1  1  1  0
>

Your code is OK and doesn't give the "invalid formula" message with  
the current R (is this the one you are using?).

The example data wont work because all the y values are zero.

Ken




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