Some minor comments [Power / Sample Size]
Thank you very much for your effort and help!
You're absolutely right! I didn't check very thoroughly but so far it seems that exactly these df are being used (this indeed makes sense as the CI is for difference in "paired means")
You put in some nice features (starting value of n and the step size), awesome. One suggestion/question from myself: should it be
Also, one could think of including n=NULL or something like that as input parameter and then return the precision if a sample size is given, that is,
The values of w coincide with those of nQuery (using "paired").
Best regards
❝ ... I strongly argue that the differences are more probably due to the different number of degrees of freedom, namely df=n-1 in the so-called 'paired' design. You (having access to nQuery) can test it with my code suggestions below.
You're absolutely right! I didn't check very thoroughly but so far it seems that exactly these df are being used (this indeed makes sense as the CI is for difference in "paired means")
❝ Here some minor code suggestions: ...
You put in some nice features (starting value of n and the step size), awesome. One suggestion/question from myself: should it be
n <- step*ceiling(n/step) instead of n <- step*trunc(n/step)? Otherwise we will get an error using e.g. w=0.3, sigma=0.2, design="2x2".Also, one could think of including n=NULL or something like that as input parameter and then return the precision if a sample size is given, that is,
if (is.null(n)) {
...
} else {
df <- eval(dfe)
if (df < 1) {
stop("n is too small!", call. = FALSE)
}
w <- sigma*sqrt(qchisq(1-gamma,df)/df*bk/n*qf(1-alpha,1,df))
return(w)
}
The values of w coincide with those of nQuery (using "paired").
Best regards
Complete thread:
- Trials to a given precision; Sample size Ben 2011-11-14 19:16
- Sample size for a given precision of CI d_labes 2011-11-16 09:40
- Sample size for a given precision of CI Ben 2011-11-18 16:57
- Sample size for a given precision of CI Ben 2011-11-21 19:13
- Some minor comments d_labes 2011-11-22 15:37
- Some minor commentsBen 2011-11-23 21:12
- Some minor comments Ben 2011-11-25 17:28
- Using undocumented functions - PowerTOST v0.9-0 d_labes 2011-12-15 09:28
- Using undocumented functions - PowerTOST v0.9-0 Ben 2011-12-16 19:06
- Using undocumented functions - PowerTOST v0.9-0 d_labes 2011-12-15 09:28
- Some minor comments Ben 2011-11-25 17:28
- Some minor commentsBen 2011-11-23 21:12
- Some minor comments d_labes 2011-11-22 15:37
- Sample size for a given precision of CI Ben 2011-11-21 19:13
- Sample size for a given precision of CI Ben 2011-11-18 16:57
- Sample size for a given precision of CI d_labes 2011-11-16 09:40
