Invalid syntax
Today, 07:03
Hi. Hope you can help me with the following question:
I am trying to run this code:
regress ln_PERCAPITA ethnici1 edumo2 edumo3 edufa2 edufa3 birthreg2 birthreg3 [iw=FEX_C] if FG==1
matrix b= e(b)'
mat list b
predict mu
gen mu_tilde= exp(mu) if FG==1
label var mu_tilde
gen e= ln_PERCAPITA-mu if FG==1
sum ethnici1 [iw=FEX_C] if FG==1
local ethnici1= `r(mean)'
sum edumo2 [iw=FEX_C] if FG==1
local edumo2= `r(mean)'
sum edumo3 [iw=FEX_C] if FG==1
local edumo3= `r(mean)'
sum edufa2 [iw=FEX_C] if FG==1
local edufa2= `r(mean)'
sum edufa3 [iw=FEX_C] if FG==1
local edufa3= `r(mean)'
sum birthreg2 [iw=FEX_C] if FG==1
local birthreg2= `r(mean)'
sum birthreg3 [iw=FEX_C] if FG==1
local birthreg3= `r(mean)'
mat C = (`ethnici1', `edumo2', `edumo3', `edufa2', `edufa3', `birthreg2', `birthreg3', 1)
mat list C
mat v= C*b
mat list v
gen v= `ethnici1'*`b1' +`edumo2'*`b2' +`edumo3'*`b3' + `edufa2'*`b4' + `edufa3'*`b5' +`birthreg2'*`b6' +`birthreg3'*`b7' + `b8'
When I try to run the last line code of "gen v", stata generates r(198) error, and says invalyd syntax. What is wrong?
That line is taking the created local variables (ethnici1, edumo2, edumo3...)and multiplying each of them with the estimated coefficients obtained in the regression and saved in the matrix b.
Thanks in advance for any help!
Today, 07:03
Hi. Hope you can help me with the following question:
I am trying to run this code:
regress ln_PERCAPITA ethnici1 edumo2 edumo3 edufa2 edufa3 birthreg2 birthreg3 [iw=FEX_C] if FG==1
matrix b= e(b)'
mat list b
predict mu
gen mu_tilde= exp(mu) if FG==1
label var mu_tilde
gen e= ln_PERCAPITA-mu if FG==1
sum ethnici1 [iw=FEX_C] if FG==1
local ethnici1= `r(mean)'
sum edumo2 [iw=FEX_C] if FG==1
local edumo2= `r(mean)'
sum edumo3 [iw=FEX_C] if FG==1
local edumo3= `r(mean)'
sum edufa2 [iw=FEX_C] if FG==1
local edufa2= `r(mean)'
sum edufa3 [iw=FEX_C] if FG==1
local edufa3= `r(mean)'
sum birthreg2 [iw=FEX_C] if FG==1
local birthreg2= `r(mean)'
sum birthreg3 [iw=FEX_C] if FG==1
local birthreg3= `r(mean)'
mat C = (`ethnici1', `edumo2', `edumo3', `edufa2', `edufa3', `birthreg2', `birthreg3', 1)
mat list C
mat v= C*b
mat list v
gen v= `ethnici1'*`b1' +`edumo2'*`b2' +`edumo3'*`b3' + `edufa2'*`b4' + `edufa3'*`b5' +`birthreg2'*`b6' +`birthreg3'*`b7' + `b8'
When I try to run the last line code of "gen v", stata generates r(198) error, and says invalyd syntax. What is wrong?
That line is taking the created local variables (ethnici1, edumo2, edumo3...)and multiplying each of them with the estimated coefficients obtained in the regression and saved in the matrix b.
Thanks in advance for any help!

Comment