I've received 100 excel data files, which I have imported and appended to a single dta file by using " xls2dta" (from ssc: ssc install xls2dta)
I have trouble with the imported date variables- they seem to be automatically formated in %tc: In the Stata data editor they seem to look allright- e.g id=2 is " 05sep2020 09:22:59" and id=5 is "31mar2020 17:03:59"
However, the format appears wrong or at least difficult to reformat, see below.
I would like to get the data in a proper Stata day-date format without clock of day.
Obviously would be tedious to change the date format in each excel file before the import
* Example generated by -dataex-. To install: ssc install dataex
clear
input float id double prv_taget
2 1914916979980.8
3 1914916979980.8
4 1914916979980.8
5 1901293439990.4
6 1901293439990.4
7 1901293439990.4
end
format %tc prv_taget
thanks, Jannik
Related Posts with Excel time- how to re-format in stata after xlsdta import?
The indenpendent variable has two catagories. Which model can I use to analyse the effect of denpendent variables on it?Dear statalist users:
My indenpendent variable has two catagories. One is theft case and the other i…
Difference in difference testing pre-treatment trendDear Statalist community,
I'm using the difference-in-difference technique to investigate the impac…
Means TestHi everyone
I know that perhaps I should not ask this question here.
But I hope you can help me.
I w…
Data transformation: creating new variables out of independent survey answersHi!
I am researching the effect of cosmetic combinations on the perception of leadership characteris…
tuples:observation numbers out of rangewhen the items are more than 10, it will cause the problem of observation numbers out of range, can …
Subscribe to:
Post Comments (Atom)
0 Response to Excel time- how to re-format in stata after xlsdta import?
Post a Comment