Learn R Programming

scdhlm (version 0.3)

design_matrix: Create a design matrix for a single-case design

Description

Create a design matrix containing a linear trend, a treatment effect, and a trend-by-treatment interaction for a single-case design with m cases and n measurement occasions.

Usage

design_matrix(m, n, treat_times = n/2 + 1, center = 0)

Arguments

m
number of cases
n
number of time points
treat_times
(Optional) vector of length m listing treatment introduction times for each case.
center
centering point for time trend.

Value

A design matrix

Examples

Run this code
design_matrix(3, 16, c(5,9,13))

Run the code above in your browser using DataLab