Hello,
I have a variable "EndDate" whose format is double yet displays as if it was %tc. I need to identify the maximum date by categories of the group "id" using this variable. After formatting the variable to %tc, the "bys id: egen max" function calculates a different %tc date compared to any of the original dates within any single id. I haven't been able to solve the problem. Thank you.
format EndDate %tc
bys id: egen maxenddate=max(EndDate)
format maxenddate %tc
id EndDate maxenddate
1 01feb2023 10:51:32 01feb2023 18:00:33
1 01feb2023 18:00:14 01feb2023 18:00:33
1 31jan2023 06:45:08 01feb2023 18:00:33
Related Posts with Trouble working with %tc dates
Graph by categories and groupsTrying to plot a graph (scatter plot with line ) using a variable (rip) which takes values different…
Dynamic panel data, with small N and large TI have a panel data with N=17 and T=46. The model has a dynamic specification as it includes a lagge…
Why are there three Constant Terms in Time Series FMOLS Estimation Results?Why do ı have three constant term in results table. Can anyone help with that? qui cointreg y1 x1 …
cmp models with zero-inflationI have recently started using cmp models which I find to be very much useful in building multivariat…
GLLAMM or melogit?Dear Statalist, I would like to ask you about two things for which I need your help: I am working …
Subscribe to:
Post Comments (Atom)
0 Response to Trouble working with %tc dates
Post a Comment