Hi,
I'm trying to merge two dates variables from the same dataset, but I would like to prioritize one on the other:
considering date1 and date2
I would like to generate date3 = date1, except if date1 is missing, then replacing by date2
I tried :
gen date3 = date1
replace date3 = date2 if date 1 == "."
but I got a type mismatch message, even if my variables are all in numeric daily date (float)
I hope I'm clear and someone can help me,
Many thanks
El
Ps: Merry Christmas!
Related Posts with Merging dates
Overlaying many (a lot of) points in spmapDear all I am trying to visualize poor access to broadband services in Denmark and have data that co…
crossed random effects with binomial dataGreeting Experts, I am using Stata to create and analyze a mixed effect model for my data. I tested…
How to flag observations with exactly two letters along with special characters - string variablesDear all, I am working with string data and I would like to flag observations for which my string v…
esttabHi.. I have some problems when using the esttab command in my regression i have many many weeks tha…
Replacing ValuesDear Stata experts, I want to replace all string values starting with 'QC_6200945' of the variable …
Subscribe to:
Post Comments (Atom)
0 Response to Merging dates
Post a Comment