Xsim: Title: Simulate Design matrix and Indicators

View source: R/04_simulation.R

XsimR Documentation

Title: Simulate Design matrix and Indicators

Description

Title: Simulate Design matrix and Indicators

Usage

Xsim(
  subject_sim = 100,
  tree = NULL,
  num_leaf = 10,
  covariates_sim = 50,
  rho = NULL,
  Sigma = NULL,
  num_branch = 3,
  num_cov = 5,
  seed = 555
)

Arguments

subject_sim

integer Number of subjects to simulate

tree

phylo The function is set to simulate the tree structure for the simulated data. Default is NULL.

covariates_sim

integer Number of covariates to simulate

rho

numeric Used for covariate correlation between 0 & 1. Default is NULL. Need either rho or Sigma to be input.

Sigma

matrix A symmetric positive definite matrix used for covariate correlation structure columns must match number of covariates. Default is NULL. Need either rho or Sigma to be input.

num_branch

integer Number of tree branches

num_cov

integer Number of associated covariates to simulate

seed

integer The desired seed for reproducibility. Default is 555.

num_leaf'integer'

Number of nodes in tree to simulate

Value

A list of outcomes including:

  • X = The design matrix

  • Zeta = The matrix indicating which covariates are significant

  • Sigma = The simulated covariance matrix

  • tree = The simulated tree, phylo object generated by the ape package


Goodgolden/LDTM documentation built on May 25, 2022, 5:25 p.m.