Hey,
I want to generate a new variable out of a variable that is already existing.
However, the existing variable contains a date and I do not know how write the if equation properly. I tried with spaces/without, with "" and without and it does not work.
That is the command:
gen war_recurrence=.
replace war_recurrence =1 if peacefail="31dec2006"
replace war_recurrence = 0 if peacefail !=31dec2006
Thankyou,
There
Related Posts with new variable: replace with nonumeric variable content
export summary statistics saved as variables to latexI have manipulated my data set such that it contains only a number of summary statistics that I want…
Multiple fixed effects using aregDear all, I am studying the determinants of peer group composition and use panel data with a sample…
fixed effect panel regression with multiple time seriesDear stata community I have to do a fixed effect panel regression with the difference in ask yield …
Fama and French industry classificationsDear Stata users, I have been struggling to convert my sic code into the 12 industries classified b…
Collapsing with class numerosity as weightDear Statalist, I am working with a large dataset (30 mln obs, 1979-2018) and would like to collaps…
Subscribe to:
Post Comments (Atom)
0 Response to new variable: replace with nonumeric variable content
Post a Comment