Hi.
I am running a regresssion with 11 independent variables trying to explain the ln of wages. The thing is that I am only interested in 8 of those independent variables for later obatining some counterfactual distributions, .
The variables I am intered in are: ethnici1 edumo2 edumo3 edufa2 edufa3 female birthreg2 birthreg3. The other 3 variables: period2 period3 id_region_birt_2, are just controls.
My question is,: how can I modify the following code, in order to just obtain mat v= C*b , where C and b onlyconsider information related to the eight above mentioned variables ?
regress ln_inglab_hora_dos ethnici1 edumo2 edumo3 edufa2 edufa3 female birthreg2 birthreg3 period2 period3 id_region_birt_2 [iw=FEX_C]
matrix b= e(b)'
mat list b
mat rowname b = b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12
mat list b
predict mu
** Smoothed distribution
gen mu_tilde= exp(mu)
label var mu_tilde "Smoothed distribution"
gen ln_mutilde = ln(mu_tilde)
** Residuales
gen e= ln_inglab_hora -mu
sum ethnici1 [iw=FEX_C]
local ethnici1= `r(mean)'
sum edumo2 [iw=FEX_C]
local edumo2= `r(mean)'
sum edumo3 [iw=FEX_C]
local edumo3= `r(mean)'
sum edufa2 [iw=FEX_C]
local edufa2= `r(mean)'
sum edufa3 [iw=FEX_C]
local edufa3= `r(mean)'
sum female [iw=FEX_C]
local female= `r(mean)'
sum birthreg2 [iw=FEX_C]
local birthreg2 = `r(mean)'
sum birthreg3 [iw=FEX_C]
local birthreg3= `r(mean)'
sum period2 [iw=FEX_C]
local period2= `r(mean)'
sum period3 [iw=FEX_C]
local period3= `r(mean)'
sum id_region_birt_2 [iw=FEX_C]
local id_region_birt_2= `r(mean)'
mat C = (`ethnici1', `edumo2', `edumo3', `edufa2', `edufa3', `female', `birthreg2', `birthreg3', `period2', `period3', `id_region_birt_2', 1)
mat list C
mat v= C*b
mat list v
gen v=`ethnici1'*b[1,1] +`edumo2'*b[2,1] +`edumo3'*b[3,1] +`edufa2'*b[4,1] +`edufa3'*b[5,1] +`female'*b[6,1] +`birthreg2'*b[7,1] +`birthreg3'*b[8,1] +`period2'*b[9,1] +`period3'*b[10,1] + `id_region_birt_2'*b[11,1] + b[12,1]
Thanksin advace for any help,
I am running a regresssion with 11 independent variables trying to explain the ln of wages. The thing is that I am only interested in 8 of those independent variables for later obatining some counterfactual distributions, .
The variables I am intered in are: ethnici1 edumo2 edumo3 edufa2 edufa3 female birthreg2 birthreg3. The other 3 variables: period2 period3 id_region_birt_2, are just controls.
My question is,: how can I modify the following code, in order to just obtain mat v= C*b , where C and b onlyconsider information related to the eight above mentioned variables ?
regress ln_inglab_hora_dos ethnici1 edumo2 edumo3 edufa2 edufa3 female birthreg2 birthreg3 period2 period3 id_region_birt_2 [iw=FEX_C]
matrix b= e(b)'
mat list b
mat rowname b = b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12
mat list b
predict mu
** Smoothed distribution
gen mu_tilde= exp(mu)
label var mu_tilde "Smoothed distribution"
gen ln_mutilde = ln(mu_tilde)
** Residuales
gen e= ln_inglab_hora -mu
sum ethnici1 [iw=FEX_C]
local ethnici1= `r(mean)'
sum edumo2 [iw=FEX_C]
local edumo2= `r(mean)'
sum edumo3 [iw=FEX_C]
local edumo3= `r(mean)'
sum edufa2 [iw=FEX_C]
local edufa2= `r(mean)'
sum edufa3 [iw=FEX_C]
local edufa3= `r(mean)'
sum female [iw=FEX_C]
local female= `r(mean)'
sum birthreg2 [iw=FEX_C]
local birthreg2 = `r(mean)'
sum birthreg3 [iw=FEX_C]
local birthreg3= `r(mean)'
sum period2 [iw=FEX_C]
local period2= `r(mean)'
sum period3 [iw=FEX_C]
local period3= `r(mean)'
sum id_region_birt_2 [iw=FEX_C]
local id_region_birt_2= `r(mean)'
mat C = (`ethnici1', `edumo2', `edumo3', `edufa2', `edufa3', `female', `birthreg2', `birthreg3', `period2', `period3', `id_region_birt_2', 1)
mat list C
mat v= C*b
mat list v
gen v=`ethnici1'*b[1,1] +`edumo2'*b[2,1] +`edumo3'*b[3,1] +`edufa2'*b[4,1] +`edufa3'*b[5,1] +`female'*b[6,1] +`birthreg2'*b[7,1] +`birthreg3'*b[8,1] +`period2'*b[9,1] +`period3'*b[10,1] + `id_region_birt_2'*b[11,1] + b[12,1]
Thanksin advace for any help,
Comment