# The plot will be saved in your working directory.
# On the grid, we have plotted a number of sample sizes we computed from real life data.
#From these values you can gauge how many samples you may need.
# Fewer samples than 50, will not result in any meaningful estimation of differences.
# For late-stage cancer you need the fewest samples, even from a very variable sample such as urine.
# You need more samples, over 200, to estimate differences between early stage cancer and
#noncancer controls.
#etc.
m <- 2
DIFF <- seq(0.1,0.50,0.01) # 0.01
VAR <- seq(0.2,4,0.1)
beta <- c(0.90,0.80,0.70)
alpha <- 1 - c(0.001, 0.01,0.05)/2
Corr <- c(0.70,0.90) #intraclass correlation also fixed
Z <- 2.6 # fix at 2.6 or use FisherInformation(???)
# You may input parameters from your pilot study. Suppose they are:
#observedPara=c(1,0.4) #the variance you computed from pilot data
observedPara <- data.frame(var=c(0.7,0.5,1.5),DIFF=c(0.37,0.33,0.43))
# you may set these values to 0, if you do not have pilot data
#observedVAR=0
#observedDIFF=0
# in this case the values computed from my pilot studies (dotted on the plot)
# may be used as guidelines.
Indicator <- 0 #1
sampleSizeContourPlots(Z,m,DIFF,VAR,beta,alpha,observedPara,Indicator)
Run the code above in your browser using DataLab