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
Fixed and Random Effects with Unit root testHello, I want to ask if I performing the Fixed Effects and Random Effects for the models of the stu…
Backward compatibility of -distinct- commandThis is to flag a small backward compatibility issue with the super-useful -distinct- command by Nic…
Survey Data - Logistic regression with numerical variableArray Array Hello all, I am currently carrying out an analysis on repeated cross sectional data. I c…
strata variable vs. covariateHello, I am using svyset , svy: glm. I am using state as my strata variable. When creating my multi…
diagnostic or post-estimation model validity test: Tobit random effect model for Panel dataDear Statalist, I want to estimate the effect of endowment on charity contribution. My dependent va…
Subscribe to:
Post Comments (Atom)
0 Response to panel data xtabs first and last occurrence
Post a Comment