Hi,
I have a a dataset such as below
input str3(A B C) str3(X Y Z)
Yes No No Yes No No
No No No Yes Yes Yes
No Yes No Yes No No
Yes No Yes No Yes No
Yes Yes No No No No
Yes No No No Yes Yes
Yes No No No
No No No No No No No
No No No No No No No
Yes No Yes No Yes No
Yes No No No No Yes
end;
i would like to count the number of "Yes" out of (A B C) columns in to count_ABC columns, which should be contain value 1 for the ist case, for 2nd case the value should be 0. Similarly count_XYZ should be 1 for the ist case and 3 for the second case.
Please guide how to go about solve this handle this with handling missing datas?
Related Posts with count categorical values by using conditions row wise
Staggered policy with boundary discontinuity designDear Statalists, Please, could anyone help me? I have a panel data set from 2001-2020, municipality …
Population pyramid, graph hbar and blabelDear Stata users, I want to use graph hbar to draw a population pyramid. Regular procedure is to ge…
Minimum number of groups for conducting multilevel latent class analysisHi Statalisters, My question is as the title. I am working on a survey data that has around 9,000 o…
Binary regression and dummies variablesHi everyone, I want to estimate the coefficient of the following regression : y = Alpha0 + Theta* d…
Inflation inexHello forum members< I have panel data for many years, and I need to adjust the Dollar value (in…
Subscribe to:
Post Comments (Atom)
0 Response to count categorical values by using conditions row wise
Post a Comment