BookmarkSubscribeRSS Feed
KB131619
Calcite | Level 5

Options NoNumber NoDate;
Data assignment4number6;
xbar = 53.87;
alpha = 0.05;
n=50;
s2 = 97.8121;
Proc Means NoPrint;
Output Out=Stat mean=xbar Var=s2 n=n;

Data assignment4number6;
t = tinv(1-alpha/2, (n-1));
sep = Sqrt(s2/n);
L1 = xbar - t*sep;
L2 = xbar + t*sep;
run;
Proc Print; Var t alpha sep L1 L2;
RUN;

 

I am trying to modify a program to get what I have here by hand.  Any help is appreciated. 

IMG_9116.JPG

4 REPLIES 4
sbxkoenk
SAS Super FREQ
Options NoNumber NoDate;
Data assignment4number6;
xbar = 53.87;
alpha = 0.05;
n = 50;
s2 = 97.8121;
t = tinv(1-alpha/2, (n-1));
*t = 2.010;
sep = sqrt(s2/n);
L1 = xbar - t*sep;
L2 = xbar + t*sep;
format t alpha sep L1 L2 14.7;
run;
Proc Print data=assignment4number6; 
 Var t alpha sep L1 L2;
run;
/* end of program */

Koen

Ksharp
Super User
Options NoNumber NoDate;
Data assignment4number6;
xbar = 53.87;
alpha = 0.05;
var = 97.8121;

n = 50;
t = quantile('t',1-alpha/2, (n-1));
/*putlog t=;*/
stderr = sqrt(var/n);
L1 = xbar - t*stderr;
L2 = xbar + t*stderr;
output;


n = 100;
t = quantile('t',1-alpha/2, (n-1));
/*putlog t=;*/
stderr = sqrt(var/n);
L1 = xbar - t*stderr;
L2 = xbar + t*stderr;
output;

format t alpha stderr L1 L2 14.7;
run;
Proc Print data=assignment4number6; 
 Var n t alpha stderr L1 L2;
run;

Ksharp_0-1741138137683.png

 

sbxkoenk
SAS Super FREQ
  • The TINV function returns the p-th quantile from the Student's t distribution with degrees of freedom df and a noncentrality parameter nc. The probability that an observation from a t distribution is less than or equal to the returned quantile is p.
    TINV accepts a noninteger degree of freedom parameter df. If the optional parameter nc is not specified or is 0, the quantile from the central t distribution is returned.
  • The QUANTILE function returns the quantile from a distribution that you specify. The QUANTILE function is the inverse of the CDF function.
    You must also specify a degree of freedom parameter df and optional noncentrality parameter nc.

I think the quantile feature is more recent and obviously more general (since you can put "all" distributions in it).

 

BR, Koen

Ksharp
Super User
Yeah. TINV function is obsoleted , now should use QUANTILE function .

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
  • 4 replies
  • 851 views
  • 2 likes
  • 3 in conversation