Hi Dason,

I tried to calculate myself the power of Welch t-test, simple right tail. power=**0.5540257**

The function leads to a different result: **power_t_test. => **power=**0.6779871**

(I think that power_t_test uses ncp=diff/(s1 / sqrt(n1/(1+(s2*n1)/(s1*n2)) not that I understand why)

Do you have any idea what is wrong with the following simple calculation?

> diff=5; s1<-10; s2<-20; n1<-30; n2<-90

> df<-(((s1^2/n1)+(s2^2/n2))^2) / ( ((s1^2/n1)^2)/(n1-1) + ((s2^2/n2)^2)/(n2-1) ) #the known formula for Welch DF

> s_stat<- sqrt((s1^2/n1)+ (s2^2/n2)) # #the known calculation for the statistic's standard deviation

> t_cr<-qt(0.95,df)

>

> #H1

> ncp<-diff/s_stat

>

> #power using non central t distribution

> 1-pt(t_cr, df, ncp)

[1] **0.5540257**

>

> df

[1] 99.97549

> t_cr

[1] 1.660238

> s_stat

[1] 2.788867

> ncp

[1] 1.792843

=========================

>library(MESS)

> power_t_test(n = 30, delta = 5, sd = 10, sig.level = 0.05, power = NULL, ratio = 3, sd.ratio = 2, type = c("two.sample"), alternative = c("one.sided"), df.method = c("welch"))

Two-sample t test power calculation with unequal sizes

n = 30, 90

delta = 5

sd = 20

sig.level = 0.05

power = 0.6779871

alternative = one.sided

NOTE: n is vector of number in each group