[R-sig-ME] data layout for crossed factors w/interaction in linear mix models

Rafael Diaz tuteson at yahoo.com
Fri Aug 21 23:59:15 CEST 2009


Please find attached data files "datos1" and "datos2" containing the data layout as described in 1) and 2), respectively, in original email below.

Note: when opening "datos2" with Notepad, the columns get scrambled (this doesn't happen with "datos1"; however, both files open nicely in Wordpad. 

Thank you very much again,

Rafael Diaz 

--- On Fri, 8/21/09, Douglas Bates <bates at stat.wisc.edu> wrote:

> From: Douglas Bates <bates at stat.wisc.edu>
> Subject: Re: [R-sig-ME] data layout for crossed factors w/interaction in  linear mix models
> To: "Rafael Diaz" <tuteson at yahoo.com>
> Cc: r-sig-mixed-models at r-project.org
> Date: Friday, August 21, 2009, 2:01 PM
> On Fri, Aug 21, 2009 at 2:22 PM,
> Rafael Diaz<tuteson at yahoo.com>
> wrote:
> > Dear All,
> 
> > I am trying to fit a simple linear mixed model (see
> below
> > this paragraph) arising from a crossed factorial
> design with
> > 2 factors and ubalanced number of replicates (from two
> to
> > five) in each cell, but I keep getting an error
> message (see
> > bottom of message).  The model is:
> 
> > yijk = intercept + ai + bj + abij + ejik, where:
> 
> > "intercept" is fixed, and the crosss factors, ai, i =
> > 1,..,10, and bj, j= 1,..,10, are random.  I am
> > interested in estimating the variance components of
> these
> > factors AND their interaction.  I have tried:
> 
> > fm1 <- lmer(formula = V1~1 + (1|V2) + (1|V3) +
> (1|V4),
> > data = 'datos') using two types of data layout for "
> 
> We will need more information before we can help you. 
> It is best if
> you can make the data available in some form. 
> Otherwise, please
> include the results of
> 
> library(lme4)
> sessionInfo()
> str(datos)
> summary(datos)
> fm1 <- lmer(V1 ~ 1 + (1|V2) + (1|V3) + (1|V4), datos)
> 
> and, if the error still occurs,
> 
> traceback()
> 
> > 1) using a matrix with 3 columns:
> >
> > y     intercept   ai's  bj's  abij's
> > y111  1           1     1     1 (1x1)
> > y112  1           1     1     "
> > y121  1           1     2     2 (1x2)
> > y122  1           1     2     "
> > y123  1           1     2     "
> > y131  1           1     3     3 (1x3)
> > .     .           .     .     .
> > .     .           .     .     .
> >
> >
> >
> > 2) using the design matrix from  Y = XBeta +Zb.
> > That is, using the same first two columns as above,
> but
> > substituting 120 columns (10 for ai's, 10 for bj's
> and 100
> > for abij's) for the last three columns.
> >
> > I get the message: "Error in eval(predvars, data, env)
> :
> > invalid envir argument"
> >
> > Is my data layout mispecified? Do I need to input
> initial
> > values for the random components in order to get the
> REML
> > estimates?  I lmer valid for unbalanced designs? 
> Any help would be greatly appreciated.
> >
> > Rafael Diaz
> > California State University Sacramento
> > Math and Stats
> >
> >>
> >>
> >>
> >
> >
> >
> >
> >
> > _______________________________________________
> > R-sig-mixed-models at r-project.org
> mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
>


      
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: datos1.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20090821/9c86f6cf/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: datos2.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20090821/9c86f6cf/attachment-0001.txt>


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