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?
Plotting a line graph of frequency of flipping a coin on different number of trialsHi All, As a newbie, I have been trying to write a code on flipping a coin. More specifically, I wri…
using bsample, cluster in conjunction with bootstrap (Stata 15)Hi, I'd been trying to set up a simple bootstrap that involves a small code that I'd written and I w…
Creating multiple new variable columns from an existingi have a dataset example below id visit_number date value test 1 2 2020-10-01 16:00 140 sodium 79 3…
Group-year FEs do not absorb the group-level treatmentHi Statalist, I'm running a DiD with a continuous treatment at the group (industry) level. The trea…
Granger causalityHi, I just had a quick question about how to compare the results of different granger causality tes…
Subscribe to:
Post Comments (Atom)
0 Response to Excel time- how to re-format in stata after xlsdta import?
Post a Comment