I am trying to run the following code and it does not seem to be working. I want to change the reference category for houseExp_pp_cat4 and youngChildAge_cat3.
foreach x of varlist edu_cat2 employmentType_n workingHourPerWeek_cat3 opdVisit_noDep medicalExam sleep_cat2 drink_cat2 smoke_cat2 homeType_cat2 nuclear_cat2 houseExp_pp_cat4
youngChildAge_cat3 totalChild18_cat2 {
if `x' != houseExp_pp_cat4 | `x' != youngChildAge_cat3 {
logistic k6cat2v2 i.`x'
}
else {
logistic k6cat2v2 ib2.`x'
}
}
Could anyone please help me figure out what the problem is?
Related Posts with If else inside for each loop
Title for graphDear all, im trying to combine to graphs and adding different titles to each one in the combined gr…
Stata command error - "Effect size and confidence intervals invalid: order should be {effect size, lower ci limit, upper ci limit}"Hi, I am using Stata 15 (64-bit). I am meta-analysing hedges g effect sizes (CI 95%). When I trans…
Unexplained component in oaxaca decompositionHi Statalisters, I am using Ben Jann's excellent "oaxaca" command. I have a question regarding inte…
Panel data dummyDear all, I have a question regarding my research into the influence of political factors on econom…
Cross-linking observationDear Statalists! I’m looking for a way to identify the ownership-path of the final investor. My dat…
Subscribe to:
Post Comments (Atom)
0 Response to If else inside for each loop
Post a Comment