Power calculation

christinett2000

New Member
Hi,
I am in need of some help on clarifying a power calculation to determine sample size for a trial.
The attached image shows a calculation that someone else completed and I am wanting to change a few factors including the true_diff/ delta to 1.

In the calculation, I just want clarification on the p_traditional and p_machine and what that is in reference to (the 0.8 and 0.9)? Do they have to be changed accordingly if I am changing delta?

Attachments

• 220.9 KB Views: 6

hlsmith

Less is more. Stay pure. Stay poor.
One seems to be for a one-sided ttest and the other for comparing proportions between two groups with the functions default settings. Please be more specific. With what you have and want to do.

christinett2000

New Member
One seems to be for a one-sided ttest and the other for comparing proportions between two groups with the functions default settings. Please be more specific. With what you have and want to do.
paste code in code block so can read maybe
Apologies for the lack of specificity:

Here is the code

base_sd_guess<-1.4
true_diff<-1
power.t.test (n=60, delta=true_diff, sd=base_sd_guess,type = "one.sample",alternative = "one.sided")

power.t.test (power=.8, delta=true_diff, sd=base_sd_guess,type = "one.sample",alternative = "one.sided")

sd(sample(1:5,10000, replace=TRUE))

p_machine <-0.8

The goal is to determine the sample size for a volunteer trial that will be rating something from 1 to 5. We need to gain a power of > 0.8, with a significant difference of 1.

hlsmith

Less is more. Stay pure. Stay poor.
And you plan to treat these discrete data as continuous and use a ttest? Also, a one-sided test is always considered a very strong assumption.

christinett2000

New Member
I am not sure about how we plan to treat it? I think it would be discrete as people would be choosing a whole number between 1 and 5?

How come a one-sided test is a strong assumption? What would you suggest otherwise?

hlsmith

Less is more. Stay pure. Stay poor.
One-sided infers the one group will only be better - you are throwing out the possibility of the other group being better. Doing one-sided also puts all of alpha on one-side, making it easier to find a difference, and if the alpha isn't corrected a slight risk for type I errors may be possible.