Hello,
I need to calculate Oster's bounds for many regressions for various R^2 and various dependent variables (y1, ..., y10) and independent variables (x1,...x10). In each regression participates only one y and only one x. For example, he calculations for the 1st regression, of y1 on x1 without looping looks as follows:
global controls a b c d f g h
reg y1 x1 $controls , robust
keep if e(sample)==1
display e(r2)
*.23529605
display=e(r2)*1.1
psacalc beta x1 , rmax(.25882565) delta(1)
display=e(r2)*1.2
psacalc beta x1, rmax(.28235526) delta(1)
display=e(r2)*1.3
psacalc beta x1, rmax(.30588486) delta(1)
display=e(r2)*1.8
psacalc beta x1, rmax(.42353289) delta(1)
display=e(r2)*2.0
psacalc beta x1, rmax(.4705921) delta(1)
display=e(r2)*2.2
psacalc beta x1, rmax(.51765131) delta(1)
psacalc beta x1, rmax(1) delta(1)
My question: how to calculate this in a loop of the type below or somehow to automate it in another way?
foreach y in y1 y2 y3 {
foreach x in x1 x2 x3 {
...
}
}
Related Posts with Automation of the calculation of Oster's bounds
Generating a new variable with standardized values compared to a healthy control group mean and SD (z scores)I'm working with crossectional test data with a selection of test results (all continuous variables)…
Esport summary statistics by 5 groupsDear all, Recfently I presented my research project to a faculty. One of the comment for improvemen…
Testing for weak instruments in 2SLS regression using robust SE (just-identified model)Hi, I'am currently struggling to test for weak instruments when conducting a 2sls regression using …
Linear mixed effects models with random effects for subjectI have a dataset of 16 patients with 10 variables. The dependent variable is "bmizpre". It is a long…
Importance of misspecification test vs. R-sq. and consequences of xtsktestDear Statalist Members, I am analyzing a balanced panel of around 2400 firms over 12 years (Stata 1…
Subscribe to:
Post Comments (Atom)
0 Response to Automation of the calculation of Oster's bounds
Post a Comment