Programming the statistical procedures from SAS

Finding the critical value of the upper confidence interval value?

Reply
Occasional Learner
Posts: 1

Finding the critical value of the upper confidence interval value?

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

Grand Advisor
Posts: 16,927

Re: Finding the critical value of the upper confidence interval value?

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. 

SAS Super FREQ
Posts: 3,319

Re: Finding the critical value of the upper confidence interval value?

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. 

Grand Advisor
Posts: 9,466

Re: Finding the critical value of the upper confidence interval value?

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


Respected Advisor
Posts: 4,606

Re: Finding the critical value of the upper confidence interval value?

[ Edited ]

"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
Grand Advisor
Posts: 9,466

Re: Finding the critical value of the upper confidence interval value?

PG,
You should use stderr=  instead of std= . They are different thing.

Respected Advisor
Posts: 4,606

Re: Finding the critical value of the upper confidence interval value?

Thank you @Ksharp, I made the correction.

PG
Ask a Question
Discussion stats
  • 6 replies
  • 371 views
  • 0 likes
  • 5 in conversation