------------------------------------------------------------------------------- name: log: stata.log log type: text opened on: 13 Oct 2026, 20:25:27 . import delimited "results/simulated-data.csv", clear varnames(1) asdouble (encoding automatically selected: ISO-8859-1) (4 vars, 500 obs) . assert _N == 500 . assert !missing(x,y) . file open output using "stata-estimates.csv", write replace (file stata-estimates.csv not found) . file write output "variance,term,n,coefficient,standard_error,ci_lower,ci_upp > er,p_value" _n . foreach variance in conventional HC1 { 2. if "`variance'" == "conventional" { 3. regress y x 4. } 5. else { 6. regress y x, vce(robust) 7. } 8. foreach term in _cons x { 9. scalar low = _b[`term'] - invttail(e(df_r),.025)*_se[`term'] 10. scalar high = _b[`term'] + invttail(e(df_r),.025)*_se[`term'] 11. scalar pval = 2*ttail(e(df_r),abs(_b[`term']/_se[`term'])) 12. local label = cond("`term'"=="_cons","intercept","x") 13. file write output "`variance',`label'," %12.0f (e(N)) "," %21.15g > (_b[`term']) "," %21.15g (_se[`term']) "," %21.15g (low) "," %21.15g (high) " > ," %21.15g (pval) _n 14. } 15. } Source | SS df MS Number of obs = 500 -------------+---------------------------------- F(1, 498) = 888.98 Model | 2554.9622 1 2554.9622 Prob > F = 0.0000 Residual | 1431.26531 498 2.87402674 R-squared = 0.6409 -------------+---------------------------------- Adj R-squared = 0.6402 Total | 3986.22752 499 7.9884319 Root MSE = 1.6953 ------------------------------------------------------------------------------ y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- x | 1.972625 .0661603 29.82 0.000 1.842637 2.102612 _cons | .8983426 .0758245 11.85 0.000 .7493672 1.047318 ------------------------------------------------------------------------------ Linear regression Number of obs = 500 F(1, 498) = 546.08 Prob > F = 0.0000 R-squared = 0.6409 Root MSE = 1.6953 ------------------------------------------------------------------------------ | Robust y | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- x | 1.972625 .0844141 23.37 0.000 1.806773 2.138476 _cons | .8983426 .0757983 11.85 0.000 .7494187 1.047267 ------------------------------------------------------------------------------ . file close output . display "ROBUST_STATA_COMPLETED" ROBUST_STATA_COMPLETED . log close name: log: stata.log log type: text closed on: 13 Oct 2026, 20:25:28 -------------------------------------------------------------------------------