help ml2mixed
-------------------------------------------------------------------------------------------------------------------------

Title

    ml2mixed --  Convert multilevel model to a mixed model


Syntax

        ml2mixed, dep(var) l2id(var) [options]


    options                  description
    -------------------------------------------------------------------------------------------------------------------
    Required
      dep(var)               Dependent variable
      l2id(var)              Level-2 id variable

    Optional
      l1(vars)               Level-1 predictors
      l2i(vars)              Level-2 intercept predictors
      l2s([l1 var] vars)     [level-1 variable] and level-2 slope predictors
      l3id(var)              Level-3 id variable
      l3i(vars)              Level-3 intercept predictors
      notes                  Display notes about mixed model

    Other Packages
      sas                    display SAS proc mixed code
      spss                   display SPSS mixed code
      r                      display R lmer code
    -------------------------------------------------------------------------------------------------------------------

Description

    The ml2mixed takes multilevel notation and converts it to a mixed notation.  ml2mixed can display mixed notation as
    Stata xtmixed, SAS proc mixed, SPSS mixed or R.  No actual dataset is required.


l2s option detail

    For the l2s option place the name of a level-1 variable in square brackets followed by the level-2 predictors of
        that slope.  This combination is repeated as many times as needed. Example:

        l2s([ses] meanses meanmath [hmwk] meanses [ach] meanses teachyr)


Examples

    2-level unconditional model

        . ml2mixed, dep(math) l2id(class)

    2-level with predictors of random intercept

        . ml2mixed, dep(math) l1(hmwk) l2id(class) l2i(meanses meanmath)

    2-level with predictors of random slope and intercept

        . ml2mixed, dep(math) l1(hmwk ses) l2id(class) l2i(meanses) l2s([ses] meanses [hmwk] meanses)

    3-level unconditional model

        . ml2mixed, dep(math) l2id(class) l3id(school)

    3-level with random intercept at level 3

        . ml2mixed, dep(math) l1(hmwk) l2id(class) l2i(meanmath) l2s([hmwk] meanmath) l3id(school) l3i(poverty)


Author

    Philip B. Ender
    UCLA Statistical Consulting Group
    ender@ucla.edu


Also see

    Online:  [R] xtmixed