
With gllamm, things become a bit complicated now. Mixed MATH HOMEWORK || SCHID: HOMEWORK, cov(unstruct) Xtmixed MATH HOMEWORK || SCHID: HOMEWORK, cov(unstruct) Gllamm MATH HOMEWORK, i(SCHID) adapt Random intercept and random slope An individual level covariate, plus random intercept However, the estimates differ slightly from those of xtmixed. If you don't want to compute the percentage of variance on both levels by hand, you may use the xtreg procedure: The examples use the option variance, which requests Stata to deliver variances on the first and second level instead of standard deviations. Whatever the default, you may request standard ML with option mle and REMLS with option reml. In version 12, and in the mixed command, this has changed to standard ML estimation. Up to and including Stata 11, xtmixed used REML (restricted Maximum Likelihood) estimation by default. Models for a metric dependent variable Basic model (estimation of variances only) Other examples (particularly for categorical dependent variables) are completely made up, but still use (by way of fiction) the variables I have just described. Of course, more independent variables may be introduced. MATH (scores obtained in mathematics) is the dependent variable SCHID is the identifier for schools (level 2) HOMEWORK is the amount of homework in hours and PUBLIC is a dummy variable for public school. The data set I have in mind is a subsample from the NELS-88 study is is used in the introductory book by Ita Kreft and Jan de Leeuw (Sage, 1998). Note that with xtmixed or mixed, you can also use factor variables. The numerous options available are not discussed here, at least for the time being, with a few exceptions. Throughout, I will provide only the minimum of commands necessary to make things run. This way, results will be very close to those of (xt)mixed. In examples that follow I always add the adapt option (for adaptive quadrature). Prefatory note 2: Multilevel models can also be estimated with gllamm, and therefore I will present a few examples that refer to this procedure. For models with metric dependent variables, I will present both the xtmixed and the mixed commands for other models (to be presented further below) I will use the new commands only. Basically, the older commands beginning with xt and the newer versions are very similar if anything does not work, please refer to the Stata help system or the handbook. However, the older commands as yet are still available (this statement currently includes version 14). that were used for estimation of multilevel models in Stata up to version 12 have been replaced by mixed, melogit and so on as of version 13. Prefatory note 1: The commands xtmixed, xtmelogit etc.


Confidence Intervals with ci and centile.Changing the Look of Lines, Symbols etc.
