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
Help with Double filter instrumental variable estimation of unblanced, dynamic data panels with xtdpdgmmDear all, I am trying to estimate some unbalanced,dynamic panels using macroeconomic data at country…
Interpretation Robustness Check tableHi there, we conducted our robustness check using "checkrob" command. As a result we got the follow…
Change Stata Dates to normal datesHi guys, I do have an issue with my dates. My dates that I imported are in stata date and I tried t…
datetime 2012-04-24 08:00:01Hello, I am trying to import "2012-04-24 08:00:01" as a datetime, but it shows as "2012-04-24 07:59…
Fd gmmHi, I am working on a research matter where i want to use First Difference GMM. My approach is: All…
Subscribe to:
Post Comments (Atom)
0 Response to count categorical values by using conditions row wise
Post a Comment