data_gen {cvmaPLFAM}R Documentation

Simulated data

Description

Simulate sample data for illustration, including a M0-column design matrix of scalar predictors, a 100-column matrix of the functional predictor, a one-column vector of mu, a one-column vector of Y, and a one-column vector of testY.

Usage

data_gen(R, K, n, M0 = 50, typ, design)

Arguments

R

A scalar of value ranging from 0.1 to 0.9. The ratio of var(mu)/var(Y).

K

A scalar. The number of replications.

n

A scalar. The sample size of simulated data.

M0

A scalar. True dimension of scalar predictors.

typ

A scalar of value 1 or 2. Type of the additive function for the functional predictor.

design

A scalar of value 1, 2, or 3. Designs 1, 2, 3 corresponding to simulation studies.

Value

A list of K simulated data sets. Each data set is of matrix type, whose first M0 columns corresponds to the design matrix of scalar predictors, followed by the recording/measurement matrix of the functional predictor, and vectors mu, Y, testY.

Examples

library(MASS)
# Example: Design 1 in simulation study
data_gen(R = 0.6, K = 2, n = 10, typ = 1, design = 1)

# Example: Design 2 in simulation study
data_gen(R = 0.3, K = 3, n = 10, typ = 2, design = 2)

# Example: Design 3 in simulation study
data_gen(R = 0.9, K = 5, n = 20, typ = 1, design = 3)



[Package cvmaPLFAM version 0.1.0 Index]