[RsR] shifted t distribution for power analysis

Olivier Renaud o||v|er@ren@ud @end|ng |rom un|ge@ch
Sat Oct 3 18:09:47 CEST 2020


Hi,
The distribution of the t statistic under the alternative hypothesis is 
not a shifted t but a t with a non-zero non-centrality parameter. rt() 
has a third argument "ncp" that precisely provides non-central t. Look 
at the help file for the definition of the ncp and its link with mean 
shift and variance.
Olivier


On 30/09/2020 10:18, Z B wrote:
> Dears,
>
> I am trying to generate 10 random numbers from  shifted to the right t
> distribution with 3 degrees of freedom. I mean the following :
> x<-rt(10,3)
>   y<-rt(10,3)+2
>
>
>   I need these two variable to calculate the the power of two sample t-test
> in order the check its robustness and that is by deriving the p values from
> 1000 samples for both x and y  and then calculate the rejection rate.But it
> is false since i found out that we talk about noncentrality parameter in
> case of t-distribution and not shift like mentioned above.how shall i do to
> express a shift to the right with an amount of 2 using the noncentrality
> parameter in R ?.i will be very grateful when i hear from you. and if there
> is whatever other solution to implement shifted to the right random
> variables then it welcome.
>
>
> Best Reguards
> Zakaria Bensmida



More information about the R-SIG-Robust mailing list