```
ipd.meta.power(
y0,
y1,
var0,
var1,
x0,
x1,
s20,
s21,
n0,
n1,
interaction,
alpha=.05,
logOR=TRUE,
level=95)
```

y0

vector of control group response

y1

vector of treatment group response

var0

vector of variances of patient-level responses for control group

var1

vector of variances of patient-level responses for treatment group

x0

vector of covariate means for control group

x1

vector of covariate means for control group

s20

vector of covariate sample variances for control group

s21

vector of covariate sample variances for treatment group

n0

vector of number of control subjects

n1

vector of number of treated subjects

interaction

scalar, supposed alternative interaction effect

alpha

scalar significance level of Wald test (two-sided)

logOR

logical, whether the effect size is logit odds ratio

level

0 to 100 level for confidence interval of variance/power estimate

- A list with the following named components:
ll {`esimated.power`

The estmated IPD meta-analysis interactive effect power`power.lower`

Lower bound for`level`

CI`power.upper`

Upper bound for`level`

CI`estimated.se`

Estimated standard error of IPD meta-analysis interaction effect`se.lower`

Lower bound for`level`

CI`se.upper`

Upper bound for`level`

CI`sigma`

Estimate of residual variance`sigma0`

Estimate of intercept random effect variance from simple RE meta-analysis with DL estimator`sigma1`

Estimate of treatment random effect variance simple RE meta-analysis with DL estimator`level`

0 to 100 level of uncertainty intervals }

The study-level data for a continuous response has effect sizes that
are the mean difference between groups; summary responses are the treatment arm means. For a binary outcome, the effect size is the log-odds ratio and the response for each treatment arm is the log odds of the mean proportion. When the effect size is the log-odds the residual variance `sigma`

is always one as is the case for a GLM model with logit link and no overdispersion.

When logOR is `FALSE`

it is assumed that the patient-level response is a continuous variable.

data(poynard) #CREATE META SUMMARY OF LOG-OR EFFECT SIZE FOR 2-YR BLEEDING EVENTS binary.mean <- function(x){ n <- length(x) if(sum(x)==0){ return(.5/(n+.5)) } else if(sum(x)==n){ return(n/(n+.5)) } else{ return(mean(x)) } } logit <- function(x){log(x/(1-x))} meta <- data.frame(p0=sapply((poynard$bleed0/poynard$n0),binary.mean)) meta$p1 <- sapply((poynard$bleed1/poynard$n1),binary.mean) meta$y0 <- logit(meta$p0) meta$y1 <- logit(meta$p1) meta$var0 <- 1/(meta$p0*(1-meta$p0)) meta$var1 <- 1/(meta$p1*(1-meta$p1)) meta$n0 <- poynard$n0 meta$n1 <- poynard$n1 #ALTERNATIVE HYPOTHESIS FOR AGE-TREATMENT EFFECT #WITH 10 YEARS CHANGE TO OR TREATMENT EFFECT exp(beta*10) #EFFECT MODIFIER CHANGES TREATMENT EFFECT BY 30% beta = log(1.3)/10 ipd.power <- ipd.meta.power( int=beta, y0=meta$y0,y1=meta$y1, var0=meta$var0,var1=meta$var1, n0=meta$n0,n1=meta$n1, x0=poynard$age0,x1=poynard$age1, s20=poynard$age.s20,s21=poynard$age.s21 ) ipd.power