Hi everyone,
Hoping to get some advice on how t ocreate a graph for my longitudinal patient panel that would capture how many patients per month (count) belonged to one group (aka on stable dose) versus belonged to another group (medication dose was reduced).
The information on whether the patient is on a stable dose can be derived from the Baseline_begins variable, which is capturing the month in which the patient was on a stable dose.
THe information on the patient whose dose was reduced can be derived from the Month_Followup_begins variable.
I tried running the following code, but pretty sure I messed it up somewhere:
To count N of patients on the baseline per month
Bysort id: egen count_baseline=count(id), by(Baseline_begins)
I tried running the same code with Followup variable, but I am getting identical results:
egen count_followup=count(id), by(Followup_begins)
id Baseline_begins Followup_begins
30 83 86
30 84 87
30 85 88
30 86 89
30 99 102
30 100 103
57 26 29
57 27 30
57 30 33
57 31 34
end
[/CODE]
I would really appreciate any suggestions!
Related Posts with Creating a graph with counts of IDs using 2 different requirements
Intercept / pseudo r-squared after mimrgnsHello everyone I do have a question about how to get the intercept in a mixed logistic modell with…
couple id, family panel dataDear stata users, In my data I have children, mother and father. There is one record for the child, …
Reduce margins in combined plot when iscale is trickyDear all, I am trying to reduce the margins after "graph combine" when having two graphs that have …
Free Causal Data Science MeetingThis might be of interest to the Stata community: Free causal data science meeting November 15th &a…
Individual trend instead of individual fixed effects?Dear All, I have a more general question, that I would like to discuss with you: In a pooled model …
Subscribe to:
Post Comments (Atom)
0 Response to Creating a graph with counts of IDs using 2 different requirements
Post a Comment