simLong: Simulate longitudinal data for boostmtree examples

View source: R/simLong.R

simLongR Documentation

Simulate longitudinal data for boostmtree examples

Description

Generate synthetic longitudinal data for continuous or binary responses.

Usage

simLong(
  n = 100,
  n.test = 0,
  n.time = 5,
  rho = 0.8,
  cor.type = c("cor.comp.sym", "cor.ar1", "cor.symm", "iid"),
  model = c(0, 1, 2, 3),
  family = c("continuous", "binary"),
  phi = 1,
  q = 0,
  ...
)

Arguments

n

Number of training subjects.

n.test

Number of additional test subjects to generate.

n.time

Controls the number and scale of repeated observation times.

rho

Working correlation parameter used by the data generator.

cor.type

Correlation structure used for the repeated errors.

model

Signal-generating model. Choose one of 0, 1, 2, or 3.

family

Response family. Choose "continuous" or "binary".

phi

Error-scale parameter.

q

Number of additional noise covariates to append to the baseline feature set.

...

Currently ignored.

Value

A list with components:

data.list

A list containing features, time, id, and y.

data

The full long-format simulated data frame.

train.index

Indices identifying the training portion of data.

formula.true

A character string describing the true signal model.

Author(s)

Hemant Ishwaran, Amol Pande, and Udaya B. Kogalur

See Also

boostmtree

Examples

set.seed(5)
sim.obj <- simLong(n = 10, n.time = 4, family = "continuous")
str(sim.obj$data.list, max.level = 1)

boostmtree documentation built on April 10, 2026, 9:10 a.m.