ttdetect {TrendInTrend} | R Documentation |
Finding a detectable odds Ratio with a given power
Description
Monte Carlo power calculation for a trend-in-trend design.
Usage
ttdetect(N, time, G, cstat, alpha_t, beta_0, power, nrep, OR.vec)
Arguments
N |
Sample Size. |
time |
Number of time points. |
G |
Number of CPE strata. |
cstat |
Value of the c-statistic. |
alpha_t |
A scaler that qunatifies the trend in exposure prevalence. |
beta_0 |
Intercept of the outcome model. |
power |
A given power. |
nrep |
Number of Monte Carlo replicates. |
OR.vec |
A vector of odds Ratios. |
Value
Power |
A vector of calculated powers for a given OR.vec |
OR.vec |
A vector of odds Ratios |
DetectDifference |
A detectable difference for a given power value |
References
Ertefaie, A., Small, D., Ji, X., Leonard, C., Hennessy, S. (2018). Statistical Power for Trend-in-trend Design. Epidemiology 29(3), e21.
Examples
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))
[Package TrendInTrend version 1.1.3 Index]