BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hhchenfx
Barite | Level 11

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

 

https://communities.sas.com/t5/Base-SAS-Programming/standard-normal-probability-density-and-cumulati...

 

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
Ksharp
Super User

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

hhchenfx
Barite | Level 11

Thanks a lot.

 

HHCFX

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1267 views
  • 0 likes
  • 2 in conversation