For a research I want to do a t-test between two populations. Since I have a fairly small sample size I want to calculate the necessary sample-size for getting a good power (0.8 is supposed to be very good).
I did calculation as below in R using the pwr.t.test() form the package "pwr". It uses Cohen's d, sample size, significance level and power, i.e. three of these to determine the fourth.
I chose a significance level of 0.05, a random power of 0.5 and then calculated Cohen's d which had me a value -0.01183773. I'm not even sure, how to handle a negative Cohen's d. I've read can be negative.
m1<- 0.3133333 ## population 1 m2<- 0.6766667 m3<- -0.4866667 m4<- 0.6566667 m5<- -0.04666667 ## population 2 m6<- 0.8066667 m7<- 0.54 m8<- -0.1066667 pooledSD<-sqrt((sd(c(m1,m2,m3,m4))+sd(c(m5,m6,m7,m8)))/2) C<-(mean(c(m1,m2,m3,m4))- mean(c(m5,m6,m7,m8)))/ (pooledSD)
In the end-effect I obtained a sample size of 54821.11 using the function an the Cohen's d obtained.
pwr.t.test(d=C, sig.level = 0.05, power = 0.5, type = "two.sample", alternative = "two.sided")
Typing into sample size n = 4, leaving out power, gives me a power of 0.05
pwr.t.test(n=4, sig.level = 0.05, d = C, type = "two.sample", alternative = "two.sided")
I have four samples in a bad scenario.
Question 1: Did I calculate Cohen's d correctly? Question 2: Does power of 0.05 using this function mean that power is non-existent?