I am using the following codes. would it be possible for me to simplify these and make them shorter. I am always getting the advice to write shortest codes but sometimes i feel it is not possible.
gen are = S2_Q2AK * S2_Q2BK
gen ki = S2_Q3AK * S2_Q3BK
gen pre = S2_Q2AP * S2_Q2BP
gen cul = S2_Q3AP * S2_Q3BP
gen dek = S2_Q2D * S2_Q2BD
gen wat = S2_Q3AD * S2_Q3BD
egen own = rowtotal ( are pre dek)
egen cul = rowtotal (ki cul wat)
Thank you in advance for all the advice i have received here. it has been so helpful with university all closing and having limited access to computer labs.
Related Posts with simplify generate codes with loops always possible?
Random and fixed effects logistic regressionHello everyone, I am working with a database that have information on a survey asking for mosquito …
Create a duplicates drop logic working for missing valueHi Statalisters, I am working on my data cleaning and have such a problem. When I use duplicat…
Omitting bar from catplot, while keeping percentagesHi, I'm having an issue with using catplot (SSC) in Stata 12.1. I want to leave some bars out, but …
Estimation of time-invariant regressors in panel models: How to implement 'xtfef' command in Stata?Dear Statalist users, Does someone know how to implement the procedure suggested in Pesaran and Zho…
svmachinesI am trying to run svmachines command and this syntax, when I run this in CV and Test predictions I …
Subscribe to:
Post Comments (Atom)
0 Response to simplify generate codes with loops always possible?
Post a Comment