I have a variable containing strings in the following format
StringVar
"2018-12-27 14:28:41.4861930"
I would like to convert it into a variable with a time format STATA will recognize, keeping the precision to the millisecond level. E.g. the # of milliseconds since 1960 would be perfect.
I tried among other things the following, but it delivered only missing values.
gen time2=clock(StringVar,"DMYhms")
Any ideas?
Thank you for the help...
Related Posts with Convert string to time including milliseconds
Plotting interactions so their cumulative effects can be illustratedHi, I am trying to plot three categorical by continuous interactions on top of one another so that …
Treat numeric variables as factor variablesI have a dataset with 3500 companies. Each company has a unique company ID (variable name is id), wh…
Zero-inflated Poisson: ratio (95% CI) for a 0,1 variableZero-inflated Poisson: ratio (95% CI) for a 0,1 variable I would greatly appreciate advice about th…
Running Difference in Difference with Fixed Effects, what assumptions to check next?I'm doing a DiD for a pension reform law that went into effect in 2016. I am using micro data from n…
Student asking advice on how to learn mixed effects models and generalized estimating equations to account for 2 eyes in 1 patientGood day everyone, I'm a beginning ophthalmology researcher/student, and I wanted to reach out peop…
Subscribe to:
Post Comments (Atom)
0 Response to Convert string to time including milliseconds
Post a Comment