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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.