[R] GLMM and data manipulation (2nd try)

From: Giovanni Petris <GPetris_at_uark.edu>
Date: Fri, 02 May 2008 15:06:31 -0500 (CDT)


I posted a question yesterday but I got no replies, so I'll try to reformulate it in a more concise way.

I have the following data, summarizing approval ratings on two different surveys for a random sample of 1600 individuals:

> ## Example: Ratings of prime minister (Agresti, Table 12.1, p.494)
> rating <- matrix(c(794, 86, 150, 570), 2, 2)
> dimnames(rating) <- list(First = c("approve", "disapprove"),

+                          Second = c("approve", "disapprove"))

> rating
Second First approve disapprove approve 794 150 disapprove 86 570

I would like to fit a logit model with approve/disapprove as response, survey (first/second) as a fixed effect, and subject as a random effect.

  1. Is it possible to fit such a model directly using "lmer"?


2) Should I unroll the table above into a dataframe containing also

   fictitious subject id's? If this is the case, what is a clean way    of doing it?

Thank you in advance,
Giovanni Petris


Giovanni Petris  <GPetris_at_uark.edu>
Associate Professor
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 02 May 2008 - 20:57:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 May 2008 - 21:30:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive