Hello STATAListers,
I'm a new user and having trouble working on a simple dataset with just 5 variables but only 3 are subject to this inquiry: "subject" (integers 1-100), the outcome "retired" (binary 0 or 1), and "date _born" (formatted as %tdnn/dd/CCYY).
I am having trouble summarizing "retired" by "date_born."
Using "List" I can confirm the subject data is all there and formatted consistently
The error I have been receiving is "date: operator invalid"
The commands I have been trying is:
. summarize retired if date_born<=01/01/2001
I've also tried a number of combinations where the date_born<2001 or date_born==[a specific mm/dd/YYY matching a subject's birthdate] but to no avail.
I'd appreciate any help regarding how to format my date_born variable to execute the command properly
Thanks!
Related Posts with Problem analyzing outcome by date
keeping observation with lowest value and get the median of thatHello, I have a panel data and I want to keep the observation with the minimum value of Days for eac…
Difference in months between dates in year-month formatHi, I am a beginner in learning stata. I have data where I have a column for month in numbers 1 to …
Transpose between row and columnHi all, I know there are lots of posts about transpose, but I still find troubles with my table. I h…
Wide to Long Reshaping Hi all, I have data in the following format: Code: * Example generated by -dataex-. For mo…
Struggling with hbarI've been working to finalize my code for a figure, and I'm struggling to be able to see the entiret…
Subscribe to:
Post Comments (Atom)
0 Response to Problem analyzing outcome by date
Post a Comment