View source: R/plm_contrasts.R
| add_dummy_variables | R Documentation |
Adds dummy variables to an scdf for calculating piecewise linear models.
add_dummy_variables(
scdf,
model = c("W", "H-M", "B&L-B"),
contrast_level = c("first", "preceding"),
contrast_slope = c("first", "preceding")
)
scdf |
A single-case data frame. See |
model |
Model used for calculating the dummy parameters (see Huitema &
McKean, 2000). Default is |
contrast_level |
Either "first", "preceding" or a contrast matrix. If NA contrast_level is a copy of contrast. |
contrast_slope |
Either "first", "preceding" or a contrast matrix. If NA contrast_level is a copy of contrast. |
This function creates dummy variables for phase levels and phase slopes according to the specified piecewise regression model. It supports different contrast coding schemes for both level and slope contrasts.
add_dummy_variables(
scdf = exampleABC,
model = "W",
contrast_level = "first",
contrast_slope = "first"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.