View Full Version : T distribution (urgent, pls help)


pohying_my
02-11-2009, 08:21 AM
hi,
i am facing the big problem in my final year project. i need to submit next week but i just realize that i am doing wrong.
Pls help
CALL RANNOR(seed,x); - this is use for the Returns a random variate from a normal distribution

if i want to returns from a t distribution, what is the coding oh??
because i really cant get it.
PLS help..
thanks

vinux
02-11-2009, 08:36 AM
It is easy.. Use TINV(RANUNI(seed),df)

pohying_my
02-16-2009, 02:27 AM
It is easy.. Use TINV(RANUNI(seed),df)

TINV(RANUNI(seed),df)...
If let say i want to change to heavier tail,like t=2 or 5, how i change the formula??
thanks

vinux
02-16-2009, 10:59 AM
TINV(RANUNI(seed),df)...
If let say i want to change to heavier tail,like t=2 or 5, how i change the formula??
thanks

I didn't get your question..is it df =2 or df =5 ?
then
use
TINV(RANUNI(seed),2) or TINV(RANUNI(seed),5)

pohying_my
02-16-2009, 06:27 PM
I didn't get your question..is it df =2 or df =5 ?
then
use
TINV(RANUNI(seed),2) or TINV(RANUNI(seed),5)

Sorry i repeat again my question.
Example,
the curve for t=1 ,df=10 and t=5,df=10 is different right?
i know that TINV(RANUNI(seed),2) df is 2. If i want to change t=1 to t=5?
How Oh?
thanks

vinux
02-16-2009, 10:09 PM
Student's t distribution only have one parameter
http://upload.wikimedia.org/math/8/c/6/8c6bb36c6500840ae81f691d1ed85f5b.png

when t =1, it is just a point. there will not any curve for this

Or is it you are looking something like this

tinv(0.82955343384897 ,10) =1
&
tinv(0.99973133319862,10) =5

pohying_my
02-19-2009, 12:07 PM
Student's t distribution only have one parameter
http://upload.wikimedia.org/math/8/c/6/8c6bb36c6500840ae81f691d1ed85f5b.png

when t =1, it is just a point. there will not any curve for this

Or is it you are looking something like this

tinv(0.82955343384897 ,10) =1
&
tinv(0.99973133319862,10) =5


I understand your meaning. I am miss understanding only.Thank your help

pohying_my
03-04-2009, 06:13 AM
Data r1_1;
mu=0;
sigma=????;
UCL=3.75;LCL=-3.75;
Do i=1 to 10000;
Do j=1 to 15000;
X=mu+sigma*TINV(RANUNI(33333),10);
If(X>UCL) or (X<LCL) then do;
ARL=j;
output;j=15001;
end;
End;
End;
run;

proc means;
var ARL;
run;


THis is the sas program that i run for find arl..
but i suddenly feel that the sigma value that i find is wrong.
i use sqrt of (df/(df-2))..
is that right?
if wrong, is that have somebody to teach me?
thanks