BookmarkSubscribeRSS Feed
twix17
Obsidian | Level 7

Hi everyone,

I need help to calculate the 95% CI for the variables  day_diff and result for the table below.

subject date2 date1 day_diff result
1001 22-Sep-22 4-Mar-22 202 1
1002 14-Dec-22 4-Mar-22 285 1
1003 26-Sep-22 5-Mar-22 205 1
1004 24-Aug-23 29-Sep-22 329 1
1005 21-Jun-23 15-Dec-22 188 1
1006 31-Oct-23 16-Dec-22 319 1
1007 15-Jun-23 16-Dec-22 181 0
1008 22-Jun-23 16-Dec-22 188 1
1009 25-May-23 16-Dec-22 160 0
1010 1-Nov-23 19-Jan-23 286 1
1011 15-Jan-24 19-Jan-23 361 1
1012 18-Jan-24 19-Jan-23 364 0
1013 22-May-23 9-Feb-23 102 1
1014 18-Jan-24 9-Feb-23 343 0
1015 6-Jun-23 30-Nov-22 188 1
1016 25-Apr-23 7-Dec-22 139 1
1017 11-Jul-23 12-Jan-23 180 1


Thanks

6 REPLIES 6
ballardw
Super User

You can calculate the upper and lower limits of continuous numeric variables in Proc MEANS, SUMMARY, UNIVARIATE, REPORT and TABULATE (and a few other places depending on what you are doing for analysis). So do you need a new data set? A report?

Do you need this calculated for some group of values or over the data set as a whole?

 

Proc means data=yourdatasetname clm ;
   var day_dif result;
run;

Will provide  confidence limits of the mean over the entire data set.

 

Confidence intervals for categorical variables is pretty much a non-starter as there isn't any standard definition of such.

twix17
Obsidian | Level 7

Hello,

 

Thanks for your response. But here is what's i am trying to create bilateral asymptotic or exact confidence intervals for binomial distributions at the 95% level.

 

Thanks again

ballardw
Super User

@twix17 wrote:

Hello,

 

Thanks for your response. But here is what's i am trying to create bilateral asymptotic or exact confidence intervals for binomial distributions at the 95% level.

 

Thanks again


Quite a bit different than your topic statement

 

Proc freq data=yourdataset;

   tables  result/ binomial (cl=exact  );  /* there are multiple options for what type of confidence limits you want to use. Look at the proc freq syntax online help for specifics and limitations*/

run;

 

You may have to specify a LEVEL='1' or Level='0' option to control which level is used for reporting. The more skewed your proportion may be (further from 50%) the more likely  this may be to look funny for your interpretation if you do not specify.

PaigeMiller
Diamond | Level 26

Result does not appear to be normally distributed. I don't know about day_diff, if that is normally distributed, but you can look into that. If day_diff is not normally distributed, you might want to look into non-parametric tests. For result, I would think that a binomial distribution test/CI would work, you can do this in PROC FREQ.

 

Also, I assume you are talking about a 95% confidence interval for the mean, but since you didn't really say that, would you please state that my assumption is correct?

--
Paige Miller
twix17
Obsidian | Level 7

Hello,

 

Thanks for your response. But here is what's i am trying to create bilateral asymptotic or exact confidence intervals for binomial distributions at the 95% level.

 

Thank you.

twix17
Obsidian | Level 7

Hi @PaigeMiller 

 

Yes, I want 95% confidence interval for the mean for the continuous variable.

 

Thank you.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 589 views
  • 2 likes
  • 3 in conversation