# Re: [R] Can lmer() fit a multilevel model embedded in a regression?

From: Andrew Gelman <gelman_at_stat.columbia.edu>
Date: Sun 21 May 2006 - 23:17:07 EST

Harold,

I'm confused now. Just for concretness, suppose we have 800 people, 82 food items, and one predictor ("folic", the folic acid concentration) at the food-item level. Then DV will be a vector of length 800, foods is an 800 x 82 matrix, sex is a vector of length 800, age is a vector of length 800, and folic is a vector of length 82. The vector of folic acid concentrations in individual diets is then just foods%*%folic, which I can call folic_indiv.

How would I fit the model in lmer(), then? There's some bit of understading that I'm still missing.

Thanks.
Andrew

Doran, Harold wrote:

> Prof Gelman:
>
> I believe the answer is yes. It sounds as though persons are partially
> crossed within food items?
>
> Assuming a logit link, the syntax might follow along the lines of
>
> fm1 <- lmer(DV ~ foods + sex + age + (1|food_item), data, family =
> binomial(link='logit'), method = "Laplace", control = list(usePQL=
> FALSE) )
>
> Maybe this gets you partly there.
>
> Harold
>
>
>
> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch on behalf of Andrew Gelman
> Sent: Sat 5/20/2006 5:49 AM
> To: r-help@stat.math.ethz.ch
> Cc: reg26@columbia.edu
> Subject: [R] Can lmer() fit a multilevel model embedded in a
> regression?
>
> I would like to fit a hierarchical regression model from Witte et al.
> (1994; see reference below). It's a logistic regression of a health
> outcome on quntities of food intake; the linear predictor has the form,
> X*beta + W*gamma,
> where X is a matrix of consumption of 82 foods (i.e., the rows of X
> represent people in the study, the columns represent different foods,
> and X_ij is the amount of food j eaten by person i); and W is a matrix
> of some other predictors (sex, age, ...).
>
> The second stage of the model is a regression of X on some food-level
> predictors.
>
> Is it possible to fit this model in (the current version of) lmer()?
> The challenge is that the persons are _not_ nested within food items, so
> it is not a simple multilevel structure.
>
> We're planning to write a Gibbs sampler and fit the model directly, but
> it would be convenient to be able to flt in lmer() as well to check.
>
> Andrew
>
> ---
>
> Reference:
>
> Witte, J. S., Greenland, S., Hale, R. W., and Bird, C. L. (1994).
> Hierarchical regression analysis applied to a
> study of multiple dietary exposures and breast cancer. Epidemiology 5,
> 612-621.
>
> --
> Andrew Gelman
> Professor, Department of Statistics
> Professor, Department of Political Science
> gelman@stat.columbia.edu
> www.stat.columbia.edu/~gelman
>
> Statistics department office:
> Social Work Bldg (Amsterdam Ave at 122 St), Room 1016
> 212-851-2142
> Political Science department office:
> International Affairs Bldg (Amsterdam Ave at 118 St), Room 731
> 212-854-7075
>
> 1255 Amsterdam Ave, Room 1016
> Columbia University
> New York, NY 10027-5904
> 212-851-2142
> (fax) 212-851-2164
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> http://www.R-project.org/posting-guide.html
>
>

```--
Andrew Gelman
Professor, Department of Statistics
Professor, Department of Political Science
gelman@stat.columbia.edu
www.stat.columbia.edu/~gelman

Statistics department office:
Social Work Bldg (Amsterdam Ave at 122 St), Room 1016
212-851-2142
Political Science department office:
International Affairs Bldg (Amsterdam Ave at 118 St), Room 731
212-854-7075

1255 Amsterdam Ave, Room 1016
Columbia University
New York, NY 10027-5904
212-851-2142
(fax) 212-851-2164

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help