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
Outreg2 in a loop and table titleHello everyone, I am facing an issue with the outreg2 command. So I am trying to run a loop like th…
Descriptive statistics after regression: multiple observations per idDear Statalist users, I am running a conditional risk set model (survival analysis), which entails …
Missing standard errors because of stratum with single sampling unit.How do I fix the problem of missing standard errors because of stratum with single sampling unit whe…
Comparison between Children in the Same HouseholdHello All, First off, allow me to apologize in advance for any errors I make in the formatting of m…
How to make a graph of mean and standard deviation?Greetings. How can I make this graph of mean and standard deviation in stata? What would the command…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding Values of A Variable based on conditions
Post a Comment