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
Creating a simple line chartHello, I hope to ask if anyone can help me create simple line charts for my panel data. The panel d…
Need suggestion to improve coefficient valuesI run fixed effect regression my dependent variable in index value 0 to 1 while independent variable…
CMP + eregressDear Statalists, I am using Stata 15, the eregress package and the cmp package. The following is th…
Extracting two dates. HELP !I have observations where the data was saved as csv files and now loaded into stata. There is the 1)…
Make margins postestimation run faster? Manual calculation for margins and 95% CI?I am running mixed effects/multilevel analyses on a very complex, very large dataset and I've notice…
Subscribe to:
Post Comments (Atom)
0 Response to Create a new variable that shows the result of tabulation
Post a Comment