Learn R Programming

MetaHD (version 0.1.4)

MetaHDInput: Creating Input Data for MetaHD When Individual-Level Data are Available

Description

The MetaHDInput function creates input data Y (treatment effects) and Slist (within-study covariance matrices) for MetaHD when individual-level data are available. Assuming that the individual-level data are in the following format, with 'study' in column 1, 'group' in column 2 and outcomes in rest of the columns, with samples in rows.

Usage

MetaHDInput(data)

Value

A list of objects containing :

  • Y: A \(K \times N\) matrix of treatment effect sizes, where \(K\) is the number of studies and \(N\) is the number of outcomes.

  • Slist: A list of length \(K\) containing \(N \times N\) within-study variance–covariance matrices of the treatment effects.

Arguments

data

a dataframe consisting of individual-level data in the format, where 'study' in column 1, 'group' in column 2 and outcomes in rest of the columns and samples in rows.

Examples

Run this code
# CREATE INPUT DATA
input_data <- MetaHDInput(realdata)

## treatment effect-sizes
Y <- input_data$Y
head(Y)

## within-study variance–covariance matrices
Slist <- input_data$Slist
head(Slist[[1]])

Run the code above in your browser using DataLab