BookmarkSubscribeRSS Feed
ariel1
Calcite | Level 5

I'm only just starting to learn SAS, so I am truely sorry if this question seems stupid, but I am working on homework for the Stats with SAS class, and I cannot figure this out.

 

My professor asked me to find the 95% confidence interval for the mean of a data set (which I did manage to do) and then he asked that I find the critical value of the upper limit fo that 95% confidence interval. How should I go about doing this?

 

PS- a word file containing my data and what code I have already completed is attached

6 REPLIES 6
Reeza
Super User

Can you include your code in your post directly not as an attachment? Most people won't open/download excel/word files from here. 

 

You can use proc means with UCLM/LCLM to get the CI. 

The Critical Value is related to the t-Score?  Assuming my definition is correct, you could take your UCLM and then convert it to at-Score using the standard formula (value-u/sd/n) where all values can be derived from your proc means output. 

 

You could also use the values within a data step and the TINV() function. 

Rick_SAS
SAS Super FREQ

Assuming you are using the standard formula, your CI is of the form

[ xbar - dx, xbar + dx]

where

dx = t(1-alpha/2, n-1) * stderr / sqrt(n).

If you know the CI and you know the standard error and you known n, you can use algebra to find the t statistic.

This same statistic appears in a lot of procedure output, so you might also see it in a table. 

Ksharp
Super User
You mean Standard Error of Mean ?


proc univariate data=sashelp.class cibasic;
var weight;
run;





The UNIVARIATE Procedure
Variable: Weight
Moments
N	19	Sum Weights	19
Mean	100.026316	Sum Observations	1900.5
Std Deviation	22.7739335	Variance	518.652047
Skewness	0.18335097	Kurtosis	0.68336484
Uncorrected SS	199435.75	Corrected SS	9335.73684
Coeff Variation	22.7679419	Std Error Mean	5.22469867   <------------ = Std Deviation/sqrt(n)
Basic Statistical Measures
Location	Variability
Mean	100.0263	Std Deviation	22.77393
Median	99.5000	Variance	518.65205
Mode	84.0000	Range	99.50000
 	 	Interquartile Range	28.50000
Note: The mode displayed is the smallest of 4 modes with a count of 2.
Basic Confidence Limits Assuming Normality
Parameter	Estimate	95% Confidence Limits
Mean	100.02632	89.04963	111.00300   <-------------------
Std Deviation	22.77393	17.20827	33.67865
Variance	518.65205	296.12462	1134


PGStats
Opal | Level 21

"the critical value of the upper limit fo that 95% confidence interval" could be interpreted in many ways. It could simply mean the upper critical value of the mean given the null hypothesis (which is silly, given the nature of the data, but hey, this is academic). 

 

proc univariate data= income;
var dollars;
output out=out mean=mean stderr=stderr n=n;
run;

data _null_;
set out;
val95 = quantile("T", 1-0.05/2, n-2) * stderr;
put mean= val95=;
run;
PG
Ksharp
Super User
PG,
You should use stderr=  instead of std= . They are different thing.

PGStats
Opal | Level 21

Thank you @Ksharp, I made the correction.

PG

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
  • 6 replies
  • 7066 views
  • 0 likes
  • 5 in conversation