simX: Simulate a design matrix of correlated continuous covariates...

Description Usage Arguments Value Examples

View source: R/simfunc.R

Description

Simulate a design matrix of correlated continuous covariates including P > N matrices.

Usage

1
2
3
4
5
simX(
  vars = c(9, 6, 10, 6, 9, 10, 12, 5, 3),
  Nobs = 50,
  distfunc = function(x) rt(x, df = 3)
)

Arguments

vars

A vector containing the number of variables to load on each respective variable cluster. For example, if you desire three clusters of variables that have 5 variables each, enter c(5, 5, 5).

Nobs

The number of observations. Defaults to 50. Can be less than the number of variables to simulate P > N data.

distfunc

A function with appropriate arguments filled in. See example. This is used to generate random observations which are "morphed" to have the correlation structure generated by this function.

Value

A matrix with the attribute "assign" indicating the cluster onto which a given variable loads.

Examples

1
simX((vars = c(16, 15, 9), Nobs = 28, distfunc = function(x) rt(x, df = 3)))

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.