Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: re:re:re:re:Re: panel data hausman negative


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: re:re:re:re:Re: panel data hausman negative
Date   Thu, 2 Oct 2003 11:34:20 +0100

Vince's code had 

local i = `i' + 1

Your code omits the "+" sign. 

However, the line 

qui by `id': replace mean`i' = mean`i'[_n]

looks as if it contains a typo. This line 
looks more conVinceing: 

qui by `id': replace mean`i' = mean`i'[_N]

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of 
> paula garcia
> Sent: 02 October 2003 11:05
> To: [email protected]
> Subject: st: re:re:re:re:Re: panel data hausman negative
> 
> 
> Mark and Vincent, thanks a lot for your help!
> 
> I am running the code that Vincent has provided but it 
> stops at the following point:
> 
> . tokenize `varlist'
> 
> . local i 1
> 
> . while "``i''" != "" {
>   2. qui by `id': gen double mean`i' = sum(``i'') / _n
>   3. qui by `id': replace mean`i' = mean`i'[_n]
>   4. qui by `id': gen double diff`i' = ``i'' - mean`i'
>   5. local newlist `newlist' mean`i' diff`i'
>   6. 
> . local i = `i'   1
>   7. }
> if not found
> r(111);
> 
> end of do-file
> r(111);
> 
> I can't find the error. Could you please help me?
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index