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
Trouble with countingThis is what my dataset looks like: Code: input float(firmid year firm_prod) long productid double …
PPML reset testHello to all of you. I have been working in a gravity model with 133 countries from 2005 to 2018 (O…
xtmelogit - How to solve the problem "error obtaining starting values; try fitting a marginal model in order to diagnose the problem"Dear all, I am been working on a study to examine the effect of two drugs (drug A = 1, drug B = 0) …
How to deal with ratios as dependent and independent variables in a panel data regressionHello everyone, I am trying to run a panel data regression for my thesis aimed at testing the relat…
Merge multiple .dta files in a folderI have an Excel file (demo.xlsx) with multiple sheets with unique sheet names (A,B,C, etc). I proces…
Subscribe to:
Post Comments (Atom)
0 Response to Recoding Values of A Variable based on conditions
Post a Comment