Hello,
I have a database in Stata and I need to count the number of nodules in each patient.
The first column gives patient ID and the second column gives nodule. Is there a command that I can use to count all the nodules in one patient ID? For example, I see in my data multiple rows have patient ID 2 and the next column gives nodule. Can I add up all the nodules in the second column for patient ID2 and so on?
clear
input float(patient_id nodule)
1 1
2 1
2 3
2 4
3 1
4 4
4 5
5 2
5 1
5 3
5 4
5 5
6 2
6 3
7 1
8 2
9 5
9 3
10 1
10 6
end
[/CODE]
0 Response to counting
Post a Comment