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
Generating a dummy for a measurement change in one independent variableDear Statalist, I am currently writing my dissertation and have encountered some difficulties that …
Fixed Effects Panel Data to Arrellano BondHi, I am estimated a fixed effects model with lagged explanatory variables (as it is hypothesised t…
diagt commandGood day, I am using diagt command on Stata 14.2 and I am interested in PPV. I am not sure which one…
Changing GDPpc to lnGDPpc changes the significance of my resultsHello, I am currently writing my undergrad dissertation, titled "The Macroeconomic Determinants of …
Multiple imputation with panel dataHello everyone, I have a panel dataset with daily data on covid-19 outcomes at country level and ot…
Subscribe to:
Post Comments (Atom)
0 Response to counting
Post a Comment