BookmarkSubscribeRSS Feed
KB131619
Calcite | Level 5

I have a sample size of 18 a variance of 6.4512 and a mean of 13.55.  I have been able to find the required CI's but I cannot figure out how to calculate a 95% prediction interval for what the mean would be of an additional sample of 10.    I have examples with data sets and I have checked online and found information with data sets.  But this is all I have to work with. 

11 REPLIES 11
KB131619
Calcite | Level 5

Also for the same problem how would I find the 95% CI for the population variance and also for the standard deviation?

Ksharp
Super User
proc univariate data=sashelp.class cibasic;
var Height;
run;

Ksharp_0-1740879309884.png

 

quickbluefish
Barite | Level 11

This sounds like homework?  Not sure this is really a SAS question so much as a basic stats question, but standard deviation is the square root of the variance.  And standard error (SE) is the standard deviation divided by the square root of the sample size.  Your 95% prediction/confidence interval (CI), in this case, is just going to be evenly distributed on either side of your mean, with the lower limit being:

mean - 1.96 * SE

...and the upper limit being:

mean + 1.96 * SE

If your current variance is, say, 16, and your population size is 18, then your SE would be 4/sqrt(18).  So.... if you increased your sample size by 10, then what is your SE?  And how does that affect the upper and lower bounds of the CI?  

I believe population standard deviation has a very slightly different formula than regular SD.  

 

ChatGPT is your friend.  Better yet, find a tiny fake dataset and calculate variance, SD, SE and CI by hand - really.  

 

KB131619
Calcite | Level 5
I know how to do all the calculations by hand.  My issue is putting it into SAS.  But thank you. 
Ksharp
Super User

If I understood your question.

 

proc reg data=sashelp.class;
model weight=;
output out=want p=pred lcl=pred_lcl ucl=pred_ucl lclm=mean_lcl uclm=mean_uclm;
quit;

proc print;run;

Ksharp_1-1740814894746.png

 

KB131619
Calcite | Level 5

Yes, so this is the problem.  I actually know how to do the bottom portion here.  My issue is instead of the data set how do I enter the top portion when I have no data set?   I also know how to do this by hand.  But every example I find for help only shows it with data sets. 

Ksharp
Super User

I don't understand.

1) you can bring data in by writing a simple data. Like:

data have;
input weight;
cards;
112
110
223
456
321
;
run;

2)you save your data in a Excel file and import it by :

proc import datafile='c:\temp\have.xlsx' out=have dbms=xlsx replace;
run;

3)you save your data in a TEXT file and impot it by:

data have;
infile 'c:\temp\hav.txt' ;
input weight;
run;
sbxkoenk
SAS Super FREQ

Just an add-on to the post of @Ksharp :

  • ‘confidence limits’ (confidence interval) = confidence limits on the *mean* prediction
  • ‘prediction limits’ (prediction interval) = confidence limits on the *individual* prediction

BR, Koen

SteveDenham
Jade | Level 19

@sbxkoenk raises an important difference. When I want a prediction interval, I am lucky enough to have the SAS/QC module licensed so that I can use PROC CAPABILITY.

 

SteveDenham

sbxkoenk
SAS Super FREQ

PROC CAPABILITY also allows for computing tolerance intervals.

 

So, there is a distinction between confidence intervals, prediction intervals and tolerance intervals.

 

Koen

SteveDenham
Jade | Level 19

And for prediction intervals there are two varieties - the first is an approximate interval containing all of k future observations, the second is an interval containing the mean of k future observations. Be sure to check the section for Methods for Computing Statistical Intervals to note the difference between the two methods.

 

SteveDenham

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 11 replies
  • 1975 views
  • 2 likes
  • 5 in conversation