Dear Statalist community!
To increase speed of a bootstrapping program, I tried out the "paralell" modul (https://github.com/gvegayon/parallel). Unfortunately, I get weird error message when trying to run parallel in my setting. Its most probably a very simple problem, but I cannot figure out. Any help is highly appreciated.
My Stata version: 15.1
I installed "paralell" modul as indicated on Github:
ssc install parallel, replace
parallel setclusters 4, f
***************************************
My do-file:
est clear
global variab "laborforce "
This here is my "program":
capture program drop bivprobit_boot
program bivprobit_boot, rclass
set more off
*the following four lines refer to macros that I use to run the biprobit model
foreach var in $variab{
foreach bw in obw {
foreach per in per_base`var'`bw' {
foreach ff in per_ff`var'`bw'{
*baseline model
biprobit (`var' = takeup $`ff' i.year ) (takeup = i.treat $`ff' i.year ) if $`per', cluster (hhid)
eststo base`var'_`bw'
*predict
predict x1b1hat , xb1
gen x1b1hat0 = x1b1hat- _b[takeup]*takeup
gen x1b1hat1 = x1b1hat0 + _b[takeup]
gen pe1 = normal(x1b1hat1) - normal(x1b1hat0)
summarize pe1
return scalar ape1= r(mean)
drop x1b1hat x1b1hat0 x1b1hat1 pe1
}
}
}
}
end
Here starts the actual bootstrapping. When trying to run this I get the error message....
foreach var in $variab {
*bootstrapping
parallel bs r(ape1), reps(50) seed(123): bivprobit_boot
eststo bootstr`var'obw
}
***********************************
Stata output:
. foreach var in $variab {
2. *bootstrapping
. parallel bs r(ape1), reps(50) seed(123): bivprobit_boot
3. eststo bootstr`var'obw
4. }
invalid 'reps'
r(198);
***********************************
Does anyone have an idea what the problem could be?
I'd appreciate this a lot!
Best,
Johanna
0 Response to Problem with "paralell" module when bootstrapping
Post a Comment