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
Question about using one seed to draw sample from multiple data set.Can anyone help me with how seed works in Stata for drawing sample from multiple data sets? I have …
PLEASE HELP: Wrangling 15-min interval smart electricity meter dataHi Hoping there's a relatively easy fix for this, because I'm new to this kind and size of data set…
Gmm arellano estimation .Hello everyone , I am writing my master thesis about determinants of international migration from d…
Principal Component Analysis selecting country and questions under conditionsHello dear statalisters, I am working with the World Value Survey that have several questions for d…
How to estimate elasticity in both sides Box-Cox transformed modelDear STATA users, I have a model that both dependent and independent variables are box-cox transfor…
Subscribe to:
Post Comments (Atom)
0 Response to Counting string variable names
Post a Comment