Hello,
I am new to the Stata community and was hoping for some help with panel data analysis. I have health care data with 'clientid' as the panel variable. However, a client may have multiple visits on the same day with different or missing data recorded on the outcome variable (surveyid provides a unique identifier for observations on the same day). Here is a sample of my dataset:
clientid date medfreq severity surveyid
1 01/02/18 1 4 12345
1 02/21/18 4 12789
1 03/08/18 12890
1 06/15/18 3 2 12990
2 01/02/18 4 12681
2 01/02/18 2 3 12688
2 03/08/18 1 3 13450
2 06/15/18 3 3 13560
I have declared my dataset as panel data without indicating the time variable since there are repeated dates, which I want to preserve. Is this the correct approach?
I want to identify the first and last occurrences that are ≥3 months apart with data recorded on "medfreq." I would then like to run a xtab to see how clients changed over time from their first to last occurrence. I didn't find any literature on this specific issue but would be grateful for any suggested code or if someone can kindly refer me to an existing reference.
Thank you,
Samira
Related Posts with panel data xtabs first and last occurrence
How to create dictionary file from SEER that Stata can read?Hi I am very new to this, so hope the question is making sense. From SEER, i was able to export a t…
How to change the range of graphsHi all, I am trying to include only a specific range of values in my graph for my x-axis. Code: t…
Help with spset and grmapHello everyone, I am currently working on making some maps in which I need to create a zoom on a se…
Removing dates within a certain threshold in long formatHi There, I have a dataset containing start and end dates of events across a number of subjects in …
mapHello everyone, I am currently working on making some maps in which I need to create a zoom on a se…
Subscribe to:
Post Comments (Atom)
0 Response to panel data xtabs first and last occurrence
Post a Comment