gendat_mvn_fe: Generate Multivariate Normal Data from Variance-Covariance...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/gendat.R

Description

Generates multivariate normal data from a p \times p variance-covariance matrix and p dimensional vector of means. k is used to define the number of primary studies

Usage

1
gendat_mvn_fe(n, Sigma, mu = NULL, k, raw = TRUE, sumFUN = cor, ...)

Arguments

n

Sample size.

Sigma

p \times p variance-covariance matrix.

mu

Mean vector. Defaults to zeros if unspecified.

k

Number of primary studies.

raw

Logical. Default is TRUE. If TRUE, returns raw data. If FALSE, returns summary function passed through sumFUN.

sumFUN

Summary function used to summarize raw data. By default data is summarized using the cor function.

...

Arguments that can be passed to MASS::mvrnorm.

Value

Returns a list of length k of raw data or summary of the data generated from a multivariate normal distribution using the variance-covariance matrix and mean vector provided.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other data generating functions: gendat_linreg_X(), gendat_linreg_y(), gendat_linreg(), gendat_mvn_a(), gendat_mvn(), gendat_vm(), gendat()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
n <- 100
Sigma <- matrix(
  data = c(
    225, 112.50, 56.25,
    112.5, 225, 112.5,
    56.25, 112.50, 225
  ),
  ncol = 3
)
mu <- c(100, 100, 100)
data <- gendat_mvn_fe(
  n = n,
  Sigma = Sigma,
  mu = mu,
  k = 20,
  raw = FALSE,
  sumFUN = cor
)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.