turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Finding the critical value of the upper confidence...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-04-2016 05:22 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ariel1

09-04-2016 06:06 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ariel1

09-04-2016 07:46 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ariel1

09-04-2016 10:15 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ariel1

09-04-2016 11:43 PM - edited 09-05-2016 01:26 PM

"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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PGStats

09-05-2016 03:56 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

09-05-2016 01:27 PM

Thank you @Ksharp, I made the correction.

PG