## Confidence Intervals and Statistical Significance

Solved
Super Contributor
Posts: 364

# Confidence Intervals and Statistical Significance

How to test in SAS whether CI95 around incidence rate (arate) before adjustment to covariate ( ci95up and ci95low ) is statistically significantly different from CI 95 around incidence rate (arate2) after adjustment (ci95up2 and ci95low2 ). I'll appreciate your help, hints or any suggestions.

``````data rate;
input counties arate	ci95up	ci95low	arate2	ci95up2	ci95low2;
cards;
1 0.0049248307	0.0051575772	0.0046920842	0.0012312077	0.0011862427	0.0011261002
2 0.0046188674	0.0051729008	0.004064834	0.0011547169	0.0011897672	0.0009755602
3 0.0044704179	0.004586433	0.0043544028	0.0011176045	0.0010548796	0.0010450567
4 0.0050796534	0.0053595804	0.0047997263	0.0012699133	0.0012327035	0.0011519343
5 0.0049783924	0.0054169662	0.0045398187	0.0012445981	0.0012459022	0.0010895565
6 0.0048053275	0.0052370211	0.0043736339	0.0012013319	0.0012045148	0.0010496721
7 0.0055029619	0.0058532686	0.0051526552	0.0013757405	0.0013462518	0.0012366373
8 0.0051496166	0.0055738675	0.0047253657	0.0012874041	0.0012819895	0.0011340878
9 0.0034690852	0.0039164533	0.0030217171	0.0008672713	0.0009007843	0.0007252121
10 0.0038353754	0.0042293908	0.0034413599	0.0009588438	0.0009727599	0.0008259264
;``````

Accepted Solutions
Solution
‎02-14-2018 12:10 PM
SAS Super FREQ
Posts: 4,241

## Re: Confidence Intervals and Statistical Significance

Perhaps you meant "compare" or "visualize" instead of "test"?  If so, look at my article on the Regression Coefficient Plot, which enables you to compare estimates from different models. For your data, it looks like this:

``````/* transpose data from wide to long */
data Want;
set Rate(rename=(arate=Estimate ci95low=LowerCL ci95up=UpperCL)
drop=arate2 ci95up2 ci95low2 in=A)
Rate(rename=(arate2=Estimate ci95low2=LowerCL ci95up2=UpperCL)
drop=arate ci95up ci95low);

if A then Type = "Before Adjustment";
else      Type = "After Adjustment ";
run;

proc sgplot data=Want;
scatter y=Counties x=Estimate / xerrorlower=LowerCL xerrorupper=UpperCL
markerattrs=(symbol=diamondfilled)
group=Type groupdisplay=cluster; /* display side-by-side estimates */
refline 0 / axis=x;
xaxis grid min=0 ;
yaxis grid colorbands=odd discreteorder=data type=discrete;
label Estimate = "Rate";
run;``````

All Replies
Highlighted
Posts: 3,016

## Re: Confidence Intervals and Statistical Significance

Cruise wrote:

How to test in SAS whether CI95 around incidence rate (arate) before adjustment to covariate ( ci95up and ci95low ) is statistically significantly different from CI 95 around incidence rate (arate2) after adjustment (ci95up2 and ci95low2 ). I'll appreciate your help, hints or any suggestions.

You can't do a statistical test to compare confidence intervals — there is no such thing. You can do a statistic test to compare arate to arate2, in which case you'd have to specify exactly what you want to compare ... do you want to compare the means, or the variances, or something else.

--
Paige Miller
Solution
‎02-14-2018 12:10 PM
SAS Super FREQ
Posts: 4,241

## Re: Confidence Intervals and Statistical Significance

Perhaps you meant "compare" or "visualize" instead of "test"?  If so, look at my article on the Regression Coefficient Plot, which enables you to compare estimates from different models. For your data, it looks like this:

``````/* transpose data from wide to long */
data Want;
set Rate(rename=(arate=Estimate ci95low=LowerCL ci95up=UpperCL)
drop=arate2 ci95up2 ci95low2 in=A)
Rate(rename=(arate2=Estimate ci95low2=LowerCL ci95up2=UpperCL)
drop=arate ci95up ci95low);

if A then Type = "Before Adjustment";
else      Type = "After Adjustment ";
run;

proc sgplot data=Want;
scatter y=Counties x=Estimate / xerrorlower=LowerCL xerrorupper=UpperCL
markerattrs=(symbol=diamondfilled)
group=Type groupdisplay=cluster; /* display side-by-side estimates */
refline 0 / axis=x;
xaxis grid min=0 ;
yaxis grid colorbands=odd discreteorder=data type=discrete;
label Estimate = "Rate";
run;``````

Super Contributor
Posts: 364

## Re: Confidence Intervals and Statistical Significance

Hi @Rick_SAS,

Excellent idea to present the story by visuals. In my real data, I have 12 different rates by all 62 counties. Do you think creating chart like below is possible in SAS? Also, if I put all rate1-rate12  in same visual, would plot be still informative? rate1=crude, rate2=adjusted, rate3-rate12 different and reflected on the third variable.

SAS Super FREQ
Posts: 4,241

## Re: Confidence Intervals and Statistical Significance

Sure. Plotting the difference between rates is a standard technique, although I'm not sure how you plan to obtain the CIs. Do you have the standard errors?

For how to create similar graphs in SAS, see the last two graphs in the article "Coverage probability of confidence intervals".

To get the vertical stripes, use the BLOCK statement, as shown in this blog post.

If you run into problems, post to the SAS Graphics Support Community.  Good luck!

Super Contributor
Posts: 364

## Re: Confidence Intervals and Statistical Significance

You rock. Thanks a lot.
☑ This topic is solved.