Learn R Programming

metagen (version 1.0)

designB: Design: Binomial responses

Description

Method for generating a sampling design for data generation following a binomial-Gaussian model.

Usage

designB(n, h_bounds, a_bounds, s_bounds, r, x)

Arguments

n
resolution of the heterogeneity. n is the number of of different heterogeneity parameters in the design.
h_bounds
bounds of the heterogeneity.
a_bounds
bounds of the balancing factor of group assignments.
s_bounds
bounds of the study sizes.
r
fixed risk in the control.
x
design matrix.

Value

Function returns a data frame. Each line of this data frame can be an input to the function 'rB' which is used to sample data from such a design.

Details

Generates a sampling design for the heterogeneity 'h', balancing factors 'a1', ..., 'ak' of group assignments, and study sizes 's1', ..., 'sk'. This design can be used for testing methods for inference for the random effects meta regression model since the logarithm of relative risks of each study is approximately Gaussian distributed. One may use methods that adjust for uncertainty in the heteroscedasticity estimates by additionally considering the size of the respected studies.

Points in the design are selected via a maxi-min hypercube sampling using the 'lhs' package in a predefined parameter cube.

Examples

Run this code
dB <- designB(n=15L, h_bounds=c(0,1), a_bounds=c(-.3,3),
  s_bounds=c(200L,2000L), r=0.03, x=cbind(1,1:5))

if(!all(dim(dB) == c(15,2*dim(cbind(1,1:5))[1]+2))) {
  stop("Wrong dimension")
}

Run the code above in your browser using DataLab