Hello,
I am stuck with a problem. I hope someone can help me to find the answer.
The first part of the problem is -Write codes that prints the numbers from 1 to 100.
I have used the following commands to create the sequence
set obs 100
gen seq = int(_n)
The second part of the problem is where I am really stuck. It says- But for multiples of four print “X” instead of the number and for the multiples of five print “Y”. For numbers which are multiples of both four and five print “XY”.
I don't know how to solve the second part. Can anyone help me with the second part?
Related Posts with Recoding Values of A Variable based on conditions
Juhn, Murphy and Pierce decompositionHello to all please what is the command in stata to implement a Juhn, Murphy and Pierce decompositio…
keep with multiple answersHow do I keep multiple answers when I want state to delete some of the observations? Normally I wri…
Small N large T, independent lagged dependent with no lagSir I want to estimate a panel strongly balanced dataset where T=260 and N =30 My independent variab…
Generating dummy variable based on year-on-year changeHello, I am currently analysing the impact of capital gains tax rate changes on innovation. In orde…
xtabond2: Help on economic growth model specificationGood day everyone, Currently I'm making a thesis to see how political stability affect economic gro…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding Values of A Variable based on conditions
Post a Comment