Hi, my friend asked me the below question but I do not know the answer, could you help me ?
"
I'm doing a basic graph to show the percent of students who graduated within each major. Something like:
Biology - 50% graduate, 50% don't graduate
Art - 30% graduate, 70% don't graduate
etc.
I want to show the majors that have the highest graduation percentages at the top of my graph. However, I want to figure out if there is a way to normalize the percents. What I mean is, some majors are so small they only have 3 students total. So, some majors may have a graduation rate of 66.6%, but really that just means 2 of the 3 students graduated. I want to somehow standardize the percents based off the number of students that make up each percent so that these smaller majors are weighted less. "
In your example, what is the math that you want to use to do this standardizing?
And to be honest, I don't know either.
Maybe you want something like this:
https://blogs.sas.com/content/iml/2013/11/04/create-mosaic-plots-in-sas-by-using-proc-freq.html
As you and your friend have observed, the uncertainty in an observed proportion depends on the sample size. Majors with few students have bigger uncertainty around their point estimate than majors with many students.
There are two ways to proceed.
The simplest is to add confidence intervals (CIs) to the empirical proportion. You would sort the majors by the empirical proportion of graduates, but the CIs would indicate how confident you are in your computation. A DATA step approach would look like this:
data Graduates;
input Major $ Grads Total;
NotGrads = Total - Grads;
datalines;
A 10 22
B 10 32
C 17 25
D 4 7
E 8 14
F 16 28
G 16 19
;
data Binom;
set Graduates;
p = Grads / Total; /* empirical proportion */
StdErr = sqrt(p*(1-p)/Total);
/* use Wald 95% CIs */
z = quantile("normal", 1-0.05/2);
Lower = max(0, p - z*StdErr);
Upper = min(1, p + z*StdErr);
label p = "Proportion" Lower="Lower 95% CL" Upper="Upper 95% CL";
run;
proc sort data=Binom;
by p Lower;
run;
proc sgplot data=Binom;
scatter y=Major x=p /
xerrorlower=Lower xerrorupper=Upper;
yaxis discreteorder=data;
xaxis grid;
run;
A more sophisticated method is to use funnel plots for proportions or to incorporate the uncertainty into the ranking.
I wrote an article about this topic: "Compute and visualize binomial proportions in SAS."
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.