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?
Sparse group Lasso for multinomial logistic regressionHi everyone, I'm planning to do a multinomial logistic regression and would like to use the sparse …
Gradient code bugDear forum visitors! I got a problem, working with panel data and max likelihood model. Specificall…
Reverse Causality Test with Panel DataHi there, I was wondering if it was possible for some assistance on how to carry out a reverse caus…
Understanding command "fracreg" (fractional logistic regression)Hello everyone, I would like to apply a fractional logistic regression using the command "fracreg" …
Problem specifying conditions with ipolate commandHello, I have yearly panel data on 4 variables for all U.S. states, and the data are in wide format…
Subscribe to:
Post Comments (Atom)
0 Response to simplify generate codes with loops always possible?
Post a Comment