Dear List,
I am running two xtreg (re) models, separately for males and females, with the same LHS & RHS variables. I want to test equality of coefficients across models Male & Females with the same LHS & RHS variables. xtsur has restrictions which I can't get around [user written xtsur from http://fmwww.bc.edu/RePEc/bocode/x; Minh Cong Nguyen & Hoa Bao Nguyen dated 2009]. Using the authors example data and based on their examples I do the following and get these Stata's error. (I think I have tried every combination without success.)
Does anyone have experience with this and know of a work-around?
Thanks
Laurence
I am running two xtreg (re) models, separately for males and females, with the same LHS & RHS variables. I want to test equality of coefficients across models Male & Females with the same LHS & RHS variables. xtsur has restrictions which I can't get around [user written xtsur from http://fmwww.bc.edu/RePEc/bocode/x; Minh Cong Nguyen & Hoa Bao Nguyen dated 2009]. Using the authors example data and based on their examples I do the following and get these Stata's error. (I think I have tried every combination without success.)
Does anyone have experience with this and know of a work-around?
Thanks
Laurence
Code:
use xtsur_example.dta, clear ** This is the data that comes with xtdur help , but is called "example.dta" * Two ifs are not allowed (only one that restricts both equations (see below) global eqn1 (y1 x1 x2 x3) if PanelID<72 global eqn2 (y2 x4 x6 x7) if PanelID>71 xtsur $eqn1 $eqn2 Error: invalid '(' * Try constructing 2 variables as RHS gen Z1=y1 if PanelID<72 gen Z2=y1 if PanelID>71 global eqn1 (Z1 x1 x2 x3) global eqn2 (Z2 x1 x2 x3) xtsur $eqn1 $eqn2 (running multi-step estimates...) Error: no observations xtsur (Z1 Z2 = x1 x2 x3 x4 x6 x7 x9), onestep Error: no observations xtsur (equname1: y1 x2 x3 x4 if PanelID<72 ) (equname2: y1 x2 x3 x4) Error: if not allowed xtsur (equname1: y1 x2 x3 x4) (equname2: y1 x1 x3 x4) if PanelID<72 Ok, but not what I want
Comment