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
Labelling group patterns in concatenated variableGood morning. I would like some help regarding how to label concatenated variables. I have almost 40…
Selecting values from panel dataI have data on visits to a clinic. In the example below, "value date" is the date of the clinic visi…
Westerlund ECM panel cointegrationGood morning, I would like to apply a Westerlund and Edgerton (2007) panel bootstrap cointegration t…
combining dates in 2 different columnsDear Stata forum members, I need advise on how to combine dates in 2 different columns in to one co…
Solving complex equations with STATADear Statalists, can anybody help me solve equations with STATA? In particular, I have one equation …
Subscribe to:
Post Comments (Atom)
0 Response to count categorical values by using conditions row wise
Post a Comment