Message-ID: <631da4f8-8657-ce99-5c24-ff077971a413@unige.ch>
Date: 2020-10-03T16:09:47Z
From: Olivier Renaud
Subject: [RsR] shifted t distribution for power analysis
In-Reply-To: <CACgFjqQU05_q92kYVdV5FbhL7+mx2fO7hbH3kQEHjbg7DT3+bg@mail.gmail.com>
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