Hello,
Good evening! I need some help in counting some string variable data. Please see below the Dataex dataset.
My dataset has columns of embolictype1 to embolictype5 with the next column respective to each embolic type containing the number/quantity of that embolic type. From this database, I need to count total number of Axium, Total number of the detachable and the total number of interlocks.
Can you please help me get this Stata code for this? I will appreciate your kind help.
clear
input byte ID str10 embolic1 byte embolic1_count1 str10 embolic2 byte embolic1_count2 str10 embolic3 byte embolic1_count3 str10 embolic4 byte embolic1_count4 str10 embolic5 byte embolic1_count5
1 "axium" 1 "Interlock" 6 "Interlock" 12 "axium" 3 "Interlock" 3
2 "detachable" 6 "axium" 5 "detachable" 8 "Interlock" 4 "axium" 4
3 "Axium" 3 "axium" 4 "Interlock" 9 "detachable" 6 "Interlock" 5
4 "detachable" 11 "Interlock" 3 "axium" 11 "Interlock" 7 "axium" 3
5 "axium" 3 "detachable" 2 "detachable" 13 "detachable" 9 "detachable" 6
6 "detachable" 4 "Interlock" 3 "Interlock" 23 "Interlock" 5 "Interlock" 3
7 "Axium" 4 "Interlock" 4 "detachable" 5 "detachable" 8 "detachable" 7
8 "axium" 5 "axium" 5 "Interlock" 3 "axium" 7 "axium" 5
9 "detachable" 8 "axium" 11 "Interlock" 4 "Interlock" 6 "detachable" 4
10 "detachable" 6 "Interlock" 23 "axium" 7 "detachable" 33 "Interlock" 3
11 "Axium" 3 "axium" 21 "Interlock" 6 "Interlock" 3 "axium" 6
12 "detachable" 12 "Interlock" 9 "detachable" 5 "axium" 12 "axium" 7
13 "axium" 1 "detachable" 8 "Interlock" 23 "Interlock" 4 "axium" 4
14 "axium" 2 "Interlock" 4 "detachable" 4 "detachable" 2 "detachable" 4
15 "Axium" 3 "Interlock" 6 "axium" 1 "Interlock" 11 "Interlock" 4
end
[/CODE]
Related Posts with Counting string variable names
comparison of coefficientsDear Stata Users, I am trying to interpret a comparison of coefficients. I have two different ways…
Creation of New Variable from Long VariableHello Everyone, I am currently working on a "long" variable of 9 digits and want to make a new vari…
Linear Regression or Panel RegressionHello I just read a paper and would like to try to replicate it. However, I don't exactly understan…
Dropping all observations from a subgroup if a variable of only or more of them is negativeHi there, I'm trying to drop all observations from a subgroup if a variable of only or more of them…
Using detring to remove special charactersHi all, I'm trying to remove special characters from a string variable. I have two variables. One c…
Subscribe to:
Post Comments (Atom)
0 Response to Counting string variable names
Post a Comment