Hi there,
I am a new user here in this forum, so this is my first thread. My question:
I am trying to run the following code combining in some sense both the foreach command under a program, but dorm some reason I am not able to execute it properly. If someone can see the mistake, please let know how to solve it. Thank you in advance for you time.
program define myboot, rclass
args x
reg `x' elig esse elig_esse [aw=k_`x'] if select1==1 & esse!=0, robust
local a = _b[elig]
reg qu_m1 elig esse elig_esse [aw=k_`x'] if select1==1 & esse!=0, robust
local b = _b[elig]
return scalar ratio = a/b
end
foreach var of varlist lncn lnwr lnfoodh lnfoodout lnleisure lnotro lngasto {
bootstrap ratio_`var'=r(ratio), reps(50): myboot `var'
}
capture program drop myboot
Related Posts with Program + Foreach
Coefplot with multiple models to show change over time horizontallyHello, I'm trying to plot concertation indices for 5 variables obtained from separate linear regres…
Minimize under a restriction (in each individual)I wanna to find individual values to minimize an outcome in a restriction. *variables - fac1, ..., …
Error uninstalling a package: Criterion matches more than one packageDavid Roodman posted yesterday a discussion of xtabond2, contributed by him I installed the package …
Deriving ISEI from ISCO-08 and ISCO-88 with 2 digits. Is it possible?Hi there! I have a dataset covering 14 years, and I have isco88 and isco08 with only 2 digits for t…
Exporting shapefiles with nonconsecutive, multipart polygons using GeotoolsI am using the -geotools- command to export polygon features to an ESRI shapefile. The input geograp…
Subscribe to:
Post Comments (Atom)
0 Response to Program + Foreach
Post a Comment