Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Constructing a variable from standard deviations


From   "M.P.J. van Zaal" <Matthias.vanZaal@student.uva.nl>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Constructing a variable from standard deviations
Date   Mon, 22 Nov 2010 22:44:42 +0100

I have now run all the regression for the occupation

reg ink controls dummy1, robust
predict resid1, resid
.
reg ink controls dummy106, robust
predict resid106, resid


Then I used:
egen s = sd( res ), by(resid1-resid106)
g newerror = s*rnormal()

But now i get a variable with value "0" and frequency "6".

What did i do wrong?

I checked the stand deviations with tabstat and this works. They are all
varying even more now.
----- Original Message -----
From: Austin Nichols <austinnichols@gmail.com>
Date: Monday, November 22, 2010 9:23 pm
Subject: Re: st: Constructing a variable from standard deviations
To: statalist@hsphsun2.harvard.edu

> M.P.J. van Zaal <Matthias.vanZaal@student.uva.nl>:
> 
> Don't say "you guys claim that the estimates from this procedure would
> be meaningless" --Stas agreed with the basic approach, as do I, since
> it is standard and easily understood.  Stas almost gave you the
> answer:
> 
> regress depvar whatever i.occupation
> predict res, res
> egen s = sd( res ), by( occupation )
> g newerror = s*rnormal()
> 
> 
> On Mon, Nov 22, 2010 at 3:09 PM, M.P.J. van Zaal
> <Matthias.vanZaal@student.uva.nl> wrote:
> > I am still digesting all this new information..
> >
> > The approach used by Kit seems to be familiar to an approach i used
> > earlier. My prof gave me the advice to include all the dummies in 
> the> regression and then calculate the residual per occupation, 
> since this is
> > what Bonin et all do.
> >
> > However, you guys claim that the estimates from this procedure 
> would be
> > meaningless. I will start over again and make regression per 
> occupation> and then predict the residuals.
> >
> > When I estimate the standard error of all these residuals I will
> > probably have 106 different "variables". How can I construct one
> > variable from all these standard deviations? This is the problem at
> > which I was stuck at my old approach, so i will probably have the
> > problem again when i use a new method.
> >
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index