Dear all,
I am attempting to write a program to get the bootstraped standard errors of a generated regressor (the predicted wages are estimated by a linear regression in a first stage and then used in a probit model in a second).
It works fine when I use the standard bootstrap command, however when I try to account for the fact that I am using survey data I get the following error message: "last estimates not found".
Why doesn't Stata recognize the results stored in matrices b and V?
I read a very similar post in the old list, but it never came to a conclusion.
Would anyone kindly help me, please?
Bellow is the program I am trying to run:
svyset metapsu [pw=peso], strata(metastrat) singleunit(centered)
bsweights bw, reps(500) n(0) seed(9999)
program define ajuste, eclass properties(svyb)
syntax [pw iw] [if] [, NULLOPT]
svy: reg lsal_hora brancos negros amarelos mulher EF_i EF_c EM_i EM_c ES_i ES_c idade idade2 filtro_conj urbana metropol
predict yhat
svy: probit trabnr_filtro yhat lrenda_nao_trab1 lrenda_dom_out mulher educ idade idade2 brancos filtro_conj n_pes_com_rend metropol
matrix b = e(b)
matrix V = e(V)
ereturn post b V
end
ajuste
drop yhat
svy bootstrap _b, brsweight(bw*): ajuste
Thank you,
Luísa
I am attempting to write a program to get the bootstraped standard errors of a generated regressor (the predicted wages are estimated by a linear regression in a first stage and then used in a probit model in a second).
It works fine when I use the standard bootstrap command, however when I try to account for the fact that I am using survey data I get the following error message: "last estimates not found".
Why doesn't Stata recognize the results stored in matrices b and V?
I read a very similar post in the old list, but it never came to a conclusion.
Would anyone kindly help me, please?
Bellow is the program I am trying to run:
svyset metapsu [pw=peso], strata(metastrat) singleunit(centered)
bsweights bw, reps(500) n(0) seed(9999)
program define ajuste, eclass properties(svyb)
syntax [pw iw] [if] [, NULLOPT]
svy: reg lsal_hora brancos negros amarelos mulher EF_i EF_c EM_i EM_c ES_i ES_c idade idade2 filtro_conj urbana metropol
predict yhat
svy: probit trabnr_filtro yhat lrenda_nao_trab1 lrenda_dom_out mulher educ idade idade2 brancos filtro_conj n_pes_com_rend metropol
matrix b = e(b)
matrix V = e(V)
ereturn post b V
end
ajuste
drop yhat
svy bootstrap _b, brsweight(bw*): ajuste
Thank you,
Luísa

Comment