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]
Related Posts with counting
switch_probitHello Statalist, I am trying to use switch_probit for an endogenous switching model. I once used it…
to account for clustering or not to account for clustering?I’m doing an analysis of applicants for grants over several years. In a given year, duplicate people…
summing and subtracting when there is missingHello, I try to generate a variable that is includes missing, how can I ignore these missing values …
How to use the "replace" option with xls2dta commandHi All, I used the following command to import several Excel sheets into a dta file. It worked well…
Using SEM for estimation of a RI-CLPMI am trying to estimate a random intercept cross lagged panel model (RI-CLPM), as recommended by Ham…
Subscribe to:
Post Comments (Atom)
0 Response to counting
Post a Comment