designY: Design: Gaussian responses (known heteroscedasticity)

Description Usage Arguments Details Value Examples

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

Description

Method for generating a sampling design for data generation following a random effects meta regression model with known heteroscedasticity.

Usage

1
  designY(n, h_bounds, d_bounds, x)

Arguments

n

resolution of the heterogeneity and heteroscedasticity parameters, i.e. the number of of different (heterogeneity, heteroscedasticity) pairs in the design.

h_bounds

bounds of the heterogeneity.

d_bounds

bounds of the heteroscedasticity.

x

design matrix.

Details

Generates a sampling design for the heterogeneity 'h' and a heteroscedasticity 'd1', ..., 'dk'.

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

Value

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

Examples

1
2
3
4
5
6
dY <- designY(n=15L, h_bounds=c(0,1), d_bounds=c(0.01,2),
x=cbind(1,1:7))

if(!all(dim(dY) == c(15,dim(cbind(1,1:7))[1]+1))) {
  stop("Wrong dimension")
}

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

Related to designY in metagen...