Hello Statalist,
I consider myself a beginner, so I would appreciate your help, and thank you for this learning opportunity.
out of 800 observations, I am interested to tabulate 3 variables:
1- "biz" : which is patient id
2- "status" : which is categorical with two level= surgery and not-surgery
3- "quality" : which is categorical with two level= fail and pass
I am interested to create a new variable (let's call it percent), which has the percentage of "pass" for each biz & status.
So far I use these two commands separately, but they are not giving me what I am interested in:
. by biz status, sort: tab quality
. forvalues i=1/40 {
asdoc tab2 status qm_1 if biz==`i', append col nof save(asa)
}
They show the tabulation tables with percent fail&pass, but I don't know how to transform the percent pass as a new variable to my data set.
Again, I appreciate your help.
Best,
Mahmoud
Related Posts with Create a new variable that shows the result of tabulation
Fitting Poisson DistributionDear all, I have a variable - number of people who are malnourished in a PSU. I have approximately 2…
Palma ratioHello I have the following information How can I get the Palma ratio for each province in Iran? (Eac…
Robust option and cluster option used together in regressionIs it appropriate to use the robust option (Huber-White estimator) and cluster option together? For…
How to average duplicate variables so that I can reshape dataHey guys, This is the data I have - Code: * Example generated by -dataex-. To install: ssc insta…
The matter of separating probit and truncated regression in churdle commandHi, I'm new here. I'm currently using churdle command to implement double hurdle model, and I found…
Subscribe to:
Post Comments (Atom)
0 Response to Create a new variable that shows the result of tabulation
Post a Comment