i want to run this but i received "/invalid name" what should i revise?
use `el_data', clear
* Covariates
local indiv age_bl age_miss gender_bl rec_level_idi_bl //individual covariates
local sch_level student_teacher_ratio overage_ece_num school_year //school level covariates
* Specifications for subgroup analysis
local conditions "`"if !missing(rec_level_idi_bl)"' `"if rec_level_idi_bl == 1"' `"if (rec_level_idi_bl == 2 | rec_level_idi_bl == 3)"' `"if gender_el == 0"' `"if gender_el == 1"'"
* Set up table variables
gen Condition = ""
gen Control = .
gen ITT = .
gen ITT_pval = .
gen TrInt = .
gen TrInt_pval = .
local i 1
*Loop over conditions for subgroup analysis
foreach condition in `conditions'{
* Condition
replace Condition = "`condition'" in `i'
* Control
sum rec_level_idi_el `condition' & treatment_el == 0
replace Control = `r(mean)' in `i'
* ITT
reg rec_level_idi_el treatment_el `indiv' `sch_level' i.pca_strata `condition', cluster(school_id)
mat results = r(table)
replace ITT = results[1,1] in `i'
replace ITT_pval = results[4,1] in `i'
* TOT
ivregress 2sls rec_level_idi_el (treatment_intensity = treatment_el) `indiv' `sch_level' i.pca_strata `condition', vce(cluster school_id)
mat results = r(table)
replace TrInt = results[1,1] in `i'
replace TrInt_pval = results[4,1] in `i'
local ++i
}
use `el_data', clear
* Covariates
local indiv age_bl age_miss gender_bl rec_level_idi_bl //individual covariates
local sch_level student_teacher_ratio overage_ece_num school_year //school level covariates
* Specifications for subgroup analysis
local conditions "`"if !missing(rec_level_idi_bl)"' `"if rec_level_idi_bl == 1"' `"if (rec_level_idi_bl == 2 | rec_level_idi_bl == 3)"' `"if gender_el == 0"' `"if gender_el == 1"'"
* Set up table variables
gen Condition = ""
gen Control = .
gen ITT = .
gen ITT_pval = .
gen TrInt = .
gen TrInt_pval = .
local i 1
*Loop over conditions for subgroup analysis
foreach condition in `conditions'{
* Condition
replace Condition = "`condition'" in `i'
* Control
sum rec_level_idi_el `condition' & treatment_el == 0
replace Control = `r(mean)' in `i'
* ITT
reg rec_level_idi_el treatment_el `indiv' `sch_level' i.pca_strata `condition', cluster(school_id)
mat results = r(table)
replace ITT = results[1,1] in `i'
replace ITT_pval = results[4,1] in `i'
* TOT
ivregress 2sls rec_level_idi_el (treatment_intensity = treatment_el) `indiv' `sch_level' i.pca_strata `condition', vce(cluster school_id)
mat results = r(table)
replace TrInt = results[1,1] in `i'
replace TrInt_pval = results[4,1] in `i'
local ++i
}
Comment