On Thursday, August 21, 2014 4:20:46 PM UTC-5, Thomas Covert wrote:
>
> Is there a reference somewhere for the formula language specified in 
> DataFrames and used in MixedModels?  In particular, I'm confused about how 
> fixed- and random-effects are separately specified.  For example, suppose 
> I've got Y_{it} = X_{it}b + u_i + e_{it}.  My understanding is that a fixed 
> effect spec for this is Y ~ X + (1|i).  What is the random effects 
> specification?  If I had a separate categorical variable Z, how would I 
> write Y_{it} = X_{it}b + {Fixed effects on categories of Z} + u_i + e_{it}, 
> with random effects on i?


The formula language used in MixedModels is similar to that used in the 
lme4 package for R.  There are examples in the README.md file and in the 
demo and docs directories of the package.

To specify random effects you need to have a factor (PooledDataVector in 
Julia parlance) which would correspond to the i subscript in your 
specification.  Call this g and the response y.  Then a simple random 
effects model is written as

y ~ 1 + (1|g)

A model with covariates, x (numeric) and f (categorical) is wiitten

y ~ x + f + (1|g)

A model with these covariates, random slopes and random intercepts is 
written

y ~ x + f + (x|g)

Perhaps it would be best to use the issue tracker in the MixedModels 
package if you have further questions of this type.

>
> Thanks.
>
> -Thom
>

Reply via email to