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
drawing normally distributed random variable within an intervalHello everyone, How can I create a normally distributed variable within [a,b], with HTML Code: me…
Creating indicator variables xi, prefix() for an interaction termHi STATA friends, I aim to generate indicator variables regarding the interaction term c.budgetbala…
xtlogit with cross-autocorrelationDear all, I start my project with panel data and xtlogit command. In the case of presence of seria…
Identify observations with identical values among a group of variablesHi, Could you help me how I can browse only those observations containing similar values at least i…
Creating start and end variablesHello, I would like to create start and end variables according to the data collection wave in which…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding Values of A Variable based on conditions
Post a Comment