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
Creating matched-adjusted performance measuresHi everyone, I am new to this forum and I'm hoping that someone can help me. I have a sample of fir…
Dropping many variables if all observations contain a certain textDear All, I am having trouble with a command in Stata and no matter how much I researched beforehand…
The error 'option robust not allowed' in the "Oaxaca_rif" commandHi. I am going to use the "Oaxaca_rif" command. However, although I run the example in the help fil…
how to Graph Firms Size Distributions (FSD) pooling together all the years and a graph FSD for a certain yeari have a panel data including 350 firms over 10 years. Now I have the employee numbers, how can I ca…
Issue regarding bandwidth selection using rdrobust command-packageHi there! I am having issues determining the optimal data-driven bandwidth in a fuzzy RD design. I…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding Values of A Variable based on conditions
Post a Comment