Hello everyone!
I want to generate the count of 1's across each provision, but I want to leave out some provisions. For example, in the dataex below, I want this count only for two-digit provisions, leaving out all three-digit provisions.
when i run the following code
This generates the count across all the provisions, but I want to leave three-digit provisions (prov100; prov101; prov103; ....prov110; prov111; prov112; ....prov130; prov131; prov132) from the count.
How can I do that?
Thanks and regards
(Ridwan)
I want to generate the count of 1's across each provision, but I want to leave out some provisions. For example, in the dataex below, I want this count only for two-digit provisions, leaving out all three-digit provisions.
when i run the following code
Code:
egen count = rowtotal(prov08-prov15)
How can I do that?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str2(state_i state_k) int year byte(prov08 prov09 prov10 prov100 prov101 prov103 prov11 prov110 prov111 prov112 prov13 prov130 prov131 prov132 prov14 prov15) "JK" "BR" 1990 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 "JK" "BR" 1991 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "JK" "BR" 1992 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "JK" "LT" 1990 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 "JK" "LT" 1992 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "JK" "TR" 1990 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 "JK" "TR" 1991 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 "JK" "TR" 1992 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "ST" "AS" 1990 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "ST" "AS" 1991 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 "ST" "BR" 1990 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1 "ST" "BR" 1992 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 "ST" "LT" 1990 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "ST" "LT" 1991 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 "ST" "LT" 1992 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 end
(Ridwan)
Comment