Hi Everyone,
In my data, each row is a experiment with number of (YES), number of (NO) and a benchmark ratio.
Each row, I want to perform a test to see if the actual Yes/No ratio significantly greater than the benchmark ratio (with confident interval of 7%). I want to export the test result out.
Can you please help me with that problem?
Thank you,
HHCFX
data have;
input id yes no benchmark_ratio;
datalines;
1 90 10 0.52 55 40 0.73 50000 40000 0.5;
run;
data have; set have;
actual_ratio=yes/(yes+no);run;
data have; set have;
z=(actual_ratio-benchmark_ratio)/(benchmark_ratio*(1-benchmark_ratio)/(yes+no))**0.5;
p=1-cdf('normal',z,0,1);
if p<0.05 and z>0 then significantly_higher=1;
if p>0.95 and z<0 then significantly_lower=1;run;
https://onlinecourses.science.psu.edu/statprogram/node/164
data a;
x=pdf('normal',1.644853627,0,1);
y=1-cdf('normal',1.644853627,0,1);run;
data have;
input id yes no benchmark_ratio;
datalines;
1 90 10 0.52 55 40 0.73 50000 40000 0.5;
run;
data have; set have;
actual_ratio=yes/(yes+no);run;
data have; set have;
z=(actual_ratio-benchmark_ratio)/(benchmark_ratio*(1-benchmark_ratio)/(yes+no))**0.5;
p=1-cdf('normal',z,0,1);
if p<0.05 and z>0 then significantly_higher=1;
if p>0.95 and z<0 then significantly_lower=1;run;
https://onlinecourses.science.psu.edu/statprogram/node/164
https://communities.sas.com/t5/Base-SAS-Programming/standard-normal-probability-density-and-cumulative-functions/td-p/15540
data a;
x=pdf('normal',1.644853627,0,1);
y=1-cdf('normal',1.644853627,0,1);run;
Change your data structure and do Z-Test or Chi-Square Test in @Rick_SAS blog:
https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html
Change your data structure and do Z-Test or Chi-Square Test in @Rick_SAS blog:
https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html
Thanks a lot.
HHCFX
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.