Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Recoding Values of A Variable based on conditions

    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?


  • #2
    This sounds like a homework problem. It is the custom here that we do not provide solutions to homework problems (or other graded work).

    Comment

    Working...
    X