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!
0 Response to Creating a graph with counts of IDs using 2 different requirements
Post a Comment