So I would like to run a regression if income is within the range of (0-10727.88).
Code:
local vars "spending inp out" foreach var of local vars { if `fam_income' <= 10727.88 { eststo: quietly regress any_`var' rand_plan_group2 rand_plan_group3 rand_plan_group4 rand_plan_group5 rand_plan_group6 demeaned_fam_start_month_site* demeaned_cal_year*, cluster(ifamily) }
Code:
<=10727.88 invalid name r(198);
Thanks!
0 Response to If statement within foreach
Post a Comment