Intrasubject CV from CI with power to R [Power / Sample Size]
Dear Earlybird, dear All,
for those who have access to R and have installed the package PowerTOST here an add-on function:
With this function you can obtain the CV from each design
known within PowerTOST.
This function will be included in the next release of PowerTOST if the author of that package will accept the code
. Any enhancement or comment welcome.
Taking the numbers from the first post in this thread and assuming 24 subjects one gets:
i.e. CV=32%.
for those who have access to R and have installed the package PowerTOST here an add-on function:
require(PowerTOST)
CVfromCI <- function(point,lower,upper,n,design="2x2",alpha=0.05)
{
if (missing(lower) | missing(upper)) stop("Lower and upper CL must be given!")
if (missing(n)) stop("Sample size must be given!")
if (missing(point)) point <- sqrt(lower*upper)
# get design characteristics
d.no <- .design.no(design)
if (is.na(d.no)) stop("Unknown design!")
desi <- .design.props(d.no)
dfe <- parse(text=desi$df[1],srcfile=NULL) #degrees of freedom as expression
tval <- qt(1-alpha,eval(dfe))
s1 <- (log(point)-log(lower))/sqrt(desi$bk/n)/tval
s2 <- (log(upper)-log(point))/sqrt(desi$bk/n)/tval
sw <- 0.5*(s1+s2)
# both estimates very different?
if (abs(s1-s2)/sw>0.1) warning("sw1, sw2 very different. Check input.")
return(se2CV(sw))
}
With this function you can obtain the CV from each design

This function will be included in the next release of PowerTOST if the author of that package will accept the code

Taking the numbers from the first post in this thread and assuming 24 subjects one gets:
CVfromCI(point=1.03,lower=0.93,upper=1.15,n=24,design="2x4x4")
[1] 0.3196356
i.e. CV=32%.
—
Regards,
Detlew
Regards,
Detlew
Complete thread:
- Intrasubject CV from replicate design earlybird 2010-11-24 16:34 [Power / Sample Size]
- Intrasubject CV from replicate design Helmut 2010-11-24 18:47
- Intrasubject CV from replicate design earlybird 2010-11-25 07:58
- Boss button Helmut 2010-11-25 13:54
- Boss button earlybird 2010-11-26 10:20
- Boss button Helmut 2010-11-25 13:54
- Intrasubject CV from replicate design earlybird 2010-11-25 07:58
- Intrasubject CV from 2x4x4 replicate crossover d_labes 2010-11-25 08:19
- Intrasubject CV from 2x4x4 replicate crossover earlybird 2010-11-25 11:08
- Intrasubject CV from CI with power to Rd_labes 2010-11-25 10:11
- Bravo! Helmut 2010-11-25 14:08
- Bravo ... oh! d_labes 2010-11-25 14:47
- PowerTOST for R Helmut 2010-12-23 03:42
- Bravo ... oh! d_labes 2010-11-25 14:47
- Bravo! Helmut 2010-11-25 14:08
- Intrasubject CV from replicate design Helmut 2010-11-24 18:47