For my Bachelor thesis I am replicating and extending research about the impact of mobile banking in Bangladesh.
I am almost through the replication part but facing an error while trying to replicate education data of a household study.
This is the following code provided.
local section Education
local index_variables sch_enrollment study_hour total_fees attendance aspirations_graduate
foreach var in passed_exam `index_variables' {
sum `var'_b if sch_enrollment != .
gen z_`var' = (`var' - `r(mean)') / `r(sd)'
gen z_`var'_b = (`var'_b - `r(mean)') / `r(sd)'
}
My problem consists in the gen_z part not working for the sch_enrollment variable (either value 1 for yes or . for no) thus blocking the creation of the other variables from index_variables.
At first I thought there might be a problem with the syntax or the local macros but they seem to be fine.
My second thought was a problem with my replication up to this point but this seems not to be case.
I would really appreciate some help in this case for I am running out of ideas by now.
Kind regards
Jan-Niclas
I am almost through the replication part but facing an error while trying to replicate education data of a household study.
This is the following code provided.
local section Education
local index_variables sch_enrollment study_hour total_fees attendance aspirations_graduate
foreach var in passed_exam `index_variables' {
sum `var'_b if sch_enrollment != .
gen z_`var' = (`var' - `r(mean)') / `r(sd)'
gen z_`var'_b = (`var'_b - `r(mean)') / `r(sd)'
}
My problem consists in the gen_z part not working for the sch_enrollment variable (either value 1 for yes or . for no) thus blocking the creation of the other variables from index_variables.
At first I thought there might be a problem with the syntax or the local macros but they seem to be fine.
My second thought was a problem with my replication up to this point but this seems not to be case.
I would really appreciate some help in this case for I am running out of ideas by now.
Kind regards
Jan-Niclas
Comment