Learn R Programming

TrendInTrend (version 1.1.2)

ttpower: Power calculation in trend-in-trend design

Description

Monte Carlo power calculation for a trend-in-trend design

Usage

ttpower(N,time,G,cstat,alpha_t,beta_0,h1.OR,nrep)

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.

h1.OR

A given odds ratio.

nrep

Number of Monte Carlo replicates.

Value

Power of detecting the given Odds Ratio

References

Ertefaie, A., Small, D. S., Ji, X., Leonard, C., & Hennessy, S. (2018) Statistical Power for Trend-in-trend Design. Epidemiology (Cambridge, Mass.), 29(3), 21-23.

Examples

Run this code
# NOT RUN {
set.seed(123)
ttpower(N=10000,time=10,G=10,cstat=0.75,alpha_t= 0.4,beta_0=-4.3,h1.OR=1.5,nrep=50)
  
# }
# NOT RUN {
   
# }

Run the code above in your browser using DataLab