Hi!
I am very new to STATA. I have seen you answer different questions regarding date-variables. Hopefully you can help me with this:
I want to merge two variables:
v1=numeric yyyymmdd variable
v2=string yyyy-mm-dd variable
-->
newdatevariable=v1
replace newdatevariable=v2
if v2<v1 or missing(v1)
Kind regards,
Jenna Najar
Related Posts with Create a new variable based on a date string variable yyyy-mm-dd and a numeric variable (yyyymmdd)
Using a Dataset as VarlistI'm trying to use one data set as the reference list to replace values in another. I suspect the cod…
Renaming variables according to positionGood morning, Long text to avoid XY problem. I'm writing a Stata code that opens and conduct clean…
Incorrect results when subtracting timeDear all I am trying to compute call duration from subtracting two time periods in Stata but I get …
firm ageHello, I have 26,000 observations. I would like to calculate the age of these incorporations. What …
How to list all unique values in the variable?Hello, I see 'unique' or 'distinct' commands will show the total number of unique values in the var…
Subscribe to:
Post Comments (Atom)
0 Response to Create a new variable based on a date string variable yyyy-mm-dd and a numeric variable (yyyymmdd)
Post a Comment