second_order_mat: Second Order Model Design Matrix

Description Usage Arguments Value Examples

Description

Obtain second order design matrix from a specified model. Optionally, be able to extract specific terms from the matrix (i.e linear terms, quadratic terms, or bilinear terms)

Usage

1
second_order_mat(model, terms = "full")

Arguments

model

Input a second order model

terms

specify if you only want to extract certain terms from the second order design matrix

Value

A design matrix from initial second order model

Examples

1
2
3
4
model2 <- lm(ybar ~ (A+B)^2 + I(A^2)+I(B^2), data= AEL_dat)
second_order_mat(model2)
second_order_mat(model2, terms = "linear")
second_order_mat(model2, terms = "quadratic")

toledo60/OACD documentation built on Feb. 15, 2021, 2:25 a.m.