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
Specifying state-specific linear time trends and potential issues of collinearityHi everyone, I am running a two way fixed effects regression with state and year fixed effects. I w…
Price trendHi all, I have a panel data of Molecules observed in quarters in each country a follows: Code: * …
graph bars that stack positive and negative valuesHi everyone, I'm trying to create a graphic with horizonal bars in which I could stack positive an…
Issue with cross-sectional regression using rangestatI'm running on this code below to do regression on stock data by combination of industry and year. …
String variable related commandsHi, I have two queries regarding the following string variables in my database: 1. String Variable…
Subscribe to:
Post Comments (Atom)
0 Response to counting
Post a Comment