getDesign: Gets a Full and Reduced Design Matrices for a Linear Model

View source: R/getDesign.R

getDesignR Documentation

Gets a Full and Reduced Design Matrices for a Linear Model

Description

This function gets full and reduced design matrix for a linear model as well as the degrees of freedom for the comparison.

Usage

getDesign(form, formred, data, tol = 1e-07)

Arguments

form

A formula or string beginning with ~ that can be interpreted as an lm formula without the outcome variable. Alternatively, a design matrix.

formred

Similar to above. except this should be a simplified model relative to form. Put another way, the design matrix for this model should span a subset of the column space of the other model

data

A data frame containing the variables specified in form.

tol

Tolerance for determining the number of linearly independent columns to determine the df of the test.

Details

If robust=TRUE, then the number of parameters being tested has to be equal to the df of the test, if not, then the covariance matrix of the parameters will be noninvertible. If robust=TRUE, then the design is rotated to a df lower dimensional space. This problem happens when testing splines, where the linear component of the full model is parameterized differently than the reduced model.

Value

Returns design matrices for the full and reduced model, the df for the comparison between the two, and a vector indicating rows with no missing data.


simonvandekar/pbj documentation built on Nov. 3, 2023, 9:33 a.m.