construct_timeAdjust: Construct the time period adjustment in the design matrix

View source: R/construct_DesMat.R

construct_timeAdjustR Documentation

Construct the time period adjustment in the design matrix

Description

Offers several options to adjust for secular trends.

Usage

construct_timeAdjust(
  Cl,
  timepoints,
  timeAdjust = "factor",
  period = NULL,
  timeBlk = NULL
)

Arguments

Cl

integer (vector), number of clusters per sequence group (in SWD), or number in control and intervention (in parallel designs)

timepoints

numeric (scalar or vector), number of timepoints (periods). If design is swd, timepoints defaults to length(Cl)+1. Defaults to 1 for parallel designs.

timeAdjust

character, specifies adjustment for time periods. One of the following: "factor", "linear", "none", "periodic". Defaults to "factor".

period

numeric (scalar)

timeBlk

an optional user defined matrix that defines the time adjustment in one cluster. Is repeated for every cluster.

Value

a matrix with one row for every cluster at every timepoint and number of columns depending of adjustment type.


SteppedPower documentation built on Sept. 13, 2023, 1:07 a.m.