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
Testing difference between BLUPS after mixedDear Statalisters, I'm running a two-level empty mixed model, with levels individuals, city and st…
The trace plot creation after data imputationHello, I struggle with creating trace plots after data imputation. Imputation code has the followi…
Creating variable from searching multiple stringsHi there - probably an easy question for most of you, but I'm new to STATA and can't find the answer…
What does -teffects ipwra- actually do?Dear Statalist I am trying to figure out to understand what -teffects ipwra- actually does. I unde…
Descriptive Statistics per Country - STATA to Work-OutputHi, I have started to work on my data do-file for my thesis I managed to run the commands I need a…
Subscribe to:
Post Comments (Atom)
0 Response to Create a new variable that shows the result of tabulation
Post a Comment