powered by
Monte Carlo power calculation for a trend-in-trend design.
ttdetect(N, time, G, cstat, alpha_t, beta_0, power, nrep, OR.vec)
Sample Size.
Number of time points.
Number of CPE strata.
Value of the c-statistic.
A scaler that qunatifies the trend in exposure prevalence.
Intercept of the outcome model.
A given power.
Number of Monte Carlo replicates.
A vector of odds Ratios.
A vector of calculated powers for a given OR.vec
A vector of odds Ratios
A detectable difference for a given power value
Ertefaie, A., Small, D., Ji, X., Leonard, C., Hennessy, S. (2018). Statistical Power for Trend-in-trend Design. Epidemiology 29(3), e21.
# NOT RUN { set.seed(123) ttdetect(N=10000,time=10,G=10,cstat=0.75,alpha_t= 0.4,beta_0=-4.3, power=0.80,nrep=50, OR.vec=c(1.9,2.0,2.1,2.2)) # }
Run the code above in your browser using DataLab