```-------------------------------------------------------------------------------
help  mltrsq                              Katja Moehring and  Alexander Schmidt
-------------------------------------------------------------------------------

Calculating R-squared after two-level mixed models (beta version)

Syntax

mltrsq [ , ] [ full ]

mltrsq is part of the mlt (multilevel tools) package.

Description

mltrsq is an postestimation command for xtmixed (Stata Version 12 or
above). It works after mixed models with two levels.  mltrsq gives two
different R-squared values for each level:

(1.) R-squared as proposed by Snijders and Bosker (1994: 350-354), also
see Snijders and Bosker (1999, 99-105); and

(2.) R-squared proposed by Bryk and Raudenbush (1992: 68).

mltrsq will use the same Likelihood-function that has been specified for
xtmixed.  Note that in Stata 12 the default Likelihood-function is Maximum
Likelihood (mle).

mltrsq provides different statistics as scalars. These results can be used
with  estimates table or  estout (if installed). We provide the following
statistics:

+----------+
----+  scalars +-------------------------------------------------------

e(N_l2)           number of level-2 units

e(sb_rsq_l1)      level-1 Snijders/Bosker R-squared

e(sb_rsq_l2)      level-2 Snijders/Bosker R-squared

e(br_rsq_l1)      level-1 Bryk/Raudenbush R-squared

e(br_rsq_l2)      level-2 Bryk/Raudenbush R-squared

Options

full lists additionally the Harmonic mean of the level-2 group sizes, which
is used for the calculation of the R-squared according to Snijders and
Bosker, and the Random-effects parameters of the specified model and
the null-model.  mltrsq will also report the variance components of the
null model and the last model estimated by the user.

Example

. net get mlt
. use redistribution.dta

Multilevel regression of "Support for income redistribution"
. xtmixed gr_incdiff sex age incperc rgdppc gini || Country: , mle var

Calculate R-sqaured
. mltrsq

Use statistics in estimation table
. est store m1
. esttab m1, stats(N_l2 sb_rsq_l1 sb_rsq_l2)

References

ISSP (2006): International Social Survey Programme - Role of Government IV,
GESIS StudyNo: ZA4700, Edition 1.0, doi:10.4232/1.4700.

Tom A.B. Snijders, and Roel J. Bosker (1994): “Modeled Variance in
Two-Level Models.” Sociological Methods & Research 22 (3), 342-363.

Tom A.B. Snijders and Roel J. Bosker (1999): Multilevel Analysis. An
Introduction to Basic and Advanced Multilevel Modeling. London: Sage.

A.S. Bryk and S.W. Raudenbush (1992): Hierarchical Linear Models in Social
and Behavioral Research: Applications and Data Analysis Methods.
Newbury Park, CA: Sage Publications.

Authors

Katja Moehring, GK SOLCIFE, University of Cologne,
moehring@wiso.uni-koeln.de, www.katjamoehring.de.

Alexander Schmidt, GK SOCLIFE and Chair for Empirical Economic and Social
Research, University of Cologne, alex@alexanderwschmidt.de,
www.alexanderwschmidt.de.

Also see

```