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
Fuzzy match via -matchit- and -reclink-Hi Statalisters, I have a project that requires me to use fuzzy match to identify firm names in dif…
Calculating conditional probabilities in Stata with continuous dataHello statalist, I am involved in a project looking at net use in preventing malaria. I have a data…
Poisson autoregressive in STATAHi All, How I can fit Poisson autoregressive model in STATA? Any help, please Thanks …
categorical timeID in tobit regression and LR test to decide between tobit and xttobitDear Statalist members. For my thesis, I am running a tobit regression with the DV being the owners…
Mixed Logit ModelWhy could not I make alternative specific alternatives in Mixed Logit Model? …
Subscribe to:
Post Comments (Atom)
0 Response to Counting string variable names
Post a Comment