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
Gravity model for importsHi, I am new to STATA and I am having some problems in estimating a fixed effects gravity model est…
Sending output to file _instead of_ Results windowI have a do-file that produces a lot of output from various types of commands. I would like to store…
Is it possible to have 0 p-value when using chi-square test?Hello, I am having difficulty interpreting the results I have. I want to check whether the probabi…
Excel formatting dimensionsDear All, I am trying to make the Excel file produced with Stata to look exactly as the prototype s…
Creating a Group VariableI want to create groups for propensity score matching. If I want to classify the data into different…
Subscribe to:
Post Comments (Atom)
0 Response to new variable: replace with nonumeric variable content
Post a Comment