Hi everyone,
I follow the post of Gould (http://www.stata.com/support/faqs/st...nd-chow-tests/) to do the Chow test, but with -xtreg,fe-
I first replicate his code with a data from Stata, and it works. I have the coefficients in Ouput 3 similar with Ouput 1. (See code below).
However, when I replicate this code with my own data, it still works until the last order.
And I have the error message (for OUTPUT 3):
Anyone could give me suggestions about my problem?
I follow the post of Gould (http://www.stata.com/support/faqs/st...nd-chow-tests/) to do the Chow test, but with -xtreg,fe-
I first replicate his code with a data from Stata, and it works. I have the coefficients in Ouput 3 similar with Ouput 1. (See code below).
However, when I replicate this code with my own data, it still works until the last order.
And I have the error message (for OUTPUT 3):
weight must be constant within id
r(199);
r(199);
Code:
//I try with this data and it works use http://www.stata-press.com/data/r13/nlswork, clear /*Output 1*/ xtreg ln_w msp age if race==1,fe cluster(id) r xtreg ln_w msp age if race==2,fe cluster(id) r cap drop g2* gen g2 = (race==2) gen g2msp = g2*msp gen g2age = g2*age /*Output 2*/ xtreg ln_w msp age g2msp g2age,fe cluster(id) r cap drop r predict r, resid sum r if race==1 cap drop w gen w = r(Var)*(r(N)-1)/(r(N)-3) if race==1 sum r if race==2 replace w = r(Var)*(r(N)-1)/(r(N)-3) if race==2 /*Output 3*/ xtreg ln_w msp age g2msp g2age [aw=1/w],fe cluster(id) r