Hello,
I write this program
1) I set dataset:
clear all
set obs 1000
set seed 12
gen x=runiform()
gen z=runiform()
gen e=rnormal(0,1)
gen y=0.5*x+e
replace x=. in 1/500
replace z=. in -500/-1
2) I write this program:
capture noisily program drop sim
program define sim, rclass
reg y x
local media1=_b[x]
reg y z
local media2=_b[z]
return scalar media = `media1' + `media2'
end
3) I use bootstrap command
bootstrap mean=r(media), reps(100): sim
But, i got this error:
"insufficient observations to compute bootstrap standard errors
no results will be saved"
I dont know if i can use bootstrap command with variables without observations in common like x and z
I did this because this is the problem that i have with my real data and i need to know this is possible.
If somebody could help me, i would appreciate it
thanks!
I write this program
1) I set dataset:
clear all
set obs 1000
set seed 12
gen x=runiform()
gen z=runiform()
gen e=rnormal(0,1)
gen y=0.5*x+e
replace x=. in 1/500
replace z=. in -500/-1
2) I write this program:
capture noisily program drop sim
program define sim, rclass
reg y x
local media1=_b[x]
reg y z
local media2=_b[z]
return scalar media = `media1' + `media2'
end
3) I use bootstrap command
bootstrap mean=r(media), reps(100): sim
But, i got this error:
"insufficient observations to compute bootstrap standard errors
no results will be saved"
I dont know if i can use bootstrap command with variables without observations in common like x and z
I did this because this is the problem that i have with my real data and i need to know this is possible.
If somebody could help me, i would appreciate it
thanks!
Comment