Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: xtmixed - standardized resuduals plot


From   Tobias Friedli <tobias.friedli@access.uzh.ch>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: xtmixed - standardized resuduals plot
Date   Fri, 3 Sep 2010 16:15:07 +0200

Thank you very much Maarten, thats exactly what i was looking for!

Could you maybe, if you have time, have a very quick look at another of my questions: "-xtmixed- Crossed effets & hierarchy"

I dont know anybody else to ask, and i cant find any more theory about my problem. This would be really nice.

This is the link: http://statalist.1588530.n2.nabble.com/xtmixed-Crossed-effets-hierarchy-td5491619.html#a5491619

regards, Toby

Tobias Friedli
Bachelor Student at the University of Zurich



On 03.09.2010, at 13:22, Maarten buis wrote:

> --- On Fri, 3/9/10, Hobst wrote:
>> I have used xtreg to fit a 3-level hierarchical model. To
>> test if the residuals on the different levels are in fact
>> nomally distributed i would like to plot histograms of
>> the standardized residuals for level-1 r(ijk), level-2
>> r(jk) and level-3 r(k).
> 
> You can get the residuals using -predict-, see the example
> below or -help xtmixed postestimation-. I used -hangroot-
> as a more convenient way of comparing the histogram with
> the theoretical normal distribution. To install it, type in 
> Stata -ssc install hangroot-.
> 
> *------------ begin example ---------------------
> webuse productivity, clear
> xtmixed gsp private emp hwy water other unemp ///
>        || region: || state:, mle
> 
> predict re, re
> predict re*, reff
> 
> // these variables are used to make sure that each
> // higher level unit (region or state) contributes
> // only one observation when potting their level
> // residuals
> bys region (re1): gen byte regionmark = _n == 1
> bys state (re2) : gen byte statemark  = _n == 1
> 
> hangroot re, ci 
> hangroot re1 if regionmark, ci
> hangroot re2 if statemark, ci
> *---------------- end example --------------------
> (For more on examples I sent to the Statalist see: 
> http://www.maartenbuis.nl/example_faq )
> 
> Hope this helps,
> Maarten
> 
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
> 
> http://www.maartenbuis.nl
> --------------------------
> 
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index