Learn R Programming

DBfit (version 2.0)

simpgen1hm2: Simulation Data Generating Function

Description

Generates the simulation data for a two-phase intervention model.

Usage

simpgen1hm2(n1, n2, rho, beta = c(0, 0, 0, 0))

Arguments

n1

number of obs in phase 1

n2

number of obs in phase 2

rho

pre-defined autoregressive parameter(s)

beta

pre-defined regression coefficients

Value

mat

a matrix containing the simulation data. The last column is the response variable. All other columns make up the design matrix.

Details

This function is used for simulations when developing the package. With pre-defined sample sizes in both phases and parameters, it returns a simulated data.

See Also

hmdesign2

Examples

Run this code
# NOT RUN {
 n1 <- 15
 n2 <- 15
 rho <- 0.6
 beta <- c(0,0,0,0)
 dat <- simpgen1hm2(n1, n2, rho, beta)
 dat
# }

Run the code above in your browser using DataLab