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?
Oaxaca & diff-in-diff advice (OLS assumtions)Hello, I am doing an oaxaca decomposition of the ethnic pay gap and then doing a diff-in-diff analy…
help with krlsHello, I'm using the krls command to predict a binary outcome (whether the patient starts dialysis …
Create a new variable with random probability and with probabilityI have to create 2 variables the first one is a random variable (e1) between 1-17 the second is a v…
Significant variable in panel regression but not in regression year by yearDear Stata users, I need your point of view about this subject. I run a xtlogit regression with the …
FMM errorI have the following estimation command using fmm: > fmm 3: regress $Y $T $X where $Y $X and $T…
Subscribe to:
Post Comments (Atom)
0 Response to simplify generate codes with loops always possible?
Post a Comment