#################################################
###
### Determining sample size in R.
###
### Testing Ho: mu = 15
### Ha: mu > 15
###
### Power power = 0.9
### Population stdev stdv = 2.32
### Difference delta = 2.5
###
### Significance level sig.level = 0.01
###
power.t.test( power = 0.9, # Power
delta = 2.5, # Difference between mu and xbar
sd = 2.32, # Standard Deviation
sig.level = 0.01, # Significance level
type = "one.sample", # Type of study
alternative = "one.sided" # Type of test
)
###################################################
### For a two sided two sample test.
### Testing Ho: mu1 = mu2
### Ha: mu1 <> mu2
power.t.test( power = 0.95, # Power
delta = 1.6, # mu1 - mu2
sd = 2.14, # Standard Deviation
sig.level = 0.02, # Significance level
type = "two.sample", # Type of study
alternative = "two.sided" # Type of test
)
hi, what about the dropout rate, how to add it there ? also how to do it for cross over ?
ReplyDelete