rB: Data generation: Log-risk-ration of a binomial-Gaussian model

Description Usage Arguments Details Value Examples

View source: R/methods-for-data-generation.R

Description

Random draws of log risk ratios from a hierarchical binomial Gaussian model.

Usage

1
  rB(n, h, s, a, r, x, b)

Arguments

n

number of draws.

h

heterogeneity.

s

study sizes.

a

balance of group assignments.

r

fixed risk in the treatment group.

x

design matrix.

b

regression coefficients.

Details

It is always assumed that at least one response in a study has happend, i.e., a response of 0 in a treatment or control group is rounded up to 1. Note that this may lead to an overestimation of small risks. If possible, make sure your sample sizes are large enough to compensate for this effect.

Value

A (2k,n) matrix. Each column is an independent draw.

Examples

1
2
3
4
5
6
h_test <- .03
x_test <- cbind(1,1:13)
b_test <- c(0.02, 0.03)
s_test <- rep(2000, 13)
a_test <- rep(.3, 13)
rB(n=10, h=h_test, s=s_test, a=a_test, r=.3, x=x_test, b=b_test)

metagen documentation built on May 2, 2019, 6:08 a.m.

Related to rB in metagen...