knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(jeksterslabRdata)

Documentation

See mvnram() for more details.

Examples

Specify mu

Single Random Data Set

Set matrices.

mu <- c(100, 100, 100)
A <- matrix(
  data = c(0, sqrt(0.26), 0, 0, 0, sqrt(0.26), 0, 0, 0),
  ncol = 3
)
S <- diag(c(225, 166.5, 116.5))
F <- I <- diag(3)

Run the function.

X <- mvnram(n = 100, mu = mu, A = A, S = S, F = F, I = I)

Explore the output.

str(X)
pairs(X)
colMeans(X)
cov(X)
cor(X)

Multiple Random Data Sets

Run the function.

Xstar <- mvnram(n = 100, mu = mu, A = A, S = S, F = F, I = I, R = 100)

Explore the output.

str(Xstar, list.len = 6)

Specify M

Single Random Data Set

Set matrices.

M <- c(100, 50, 50)
A <- matrix(
  data = c(0, sqrt(0.26), 0, 0, 0, sqrt(0.26), 0, 0, 0),
  ncol = 3
)
S <- diag(c(225, 166.5, 116.5))
F <- I <- diag(3)

Run the function.

X <- mvnram(n = 100, M = M, A = A, S = S, F = F, I = I)

Explore the output.

str(X)
pairs(X)
colMeans(X)
cov(X)
cor(X)

Multiple Random Data Sets

Run the function.

Xstar <- mvnram(n = 100, M = M, A = A, S = S, F = F, I = I, R = 100)

Explore the output.

str(Xstar, list.len = 6)

Specify mu = NULL and M = NULL

Single Random Data Set

Set matrices.

A <- matrix(
  data = c(0, sqrt(0.26), 0, 0, 0, sqrt(0.26), 0, 0, 0),
  ncol = 3
)
S <- diag(c(225, 166.5, 116.5))
F <- I <- diag(3)

Run the function.

X <- mvnram(n = 100, A = A, S = S, F = F, I = I)

Explore the output.

str(X)
pairs(X)
colMeans(X)
cov(X)
cor(X)

Multiple Random Data Sets

Run the function.

Xstar <- mvnram(n = 100, A = A, S = S, F = F, I = I, R = 100)

Explore the output.

str(Xstar, list.len = 6)


jeksterslabds/jeksterslabRdata documentation built on July 24, 2020, 5:49 a.m.