modelData: Create a _FULL_ dataset based on a model object

Description Usage Arguments Examples

View source: R/modelData.R

Description

Simple function to produce a FULL dataset (all variables) for the observations from a model run in lm(). This is useful in running a nested regression.

Usage

1
modelData(obj, all.vars = TRUE, key.variable = NULL)

Arguments

obj

Model object from an lm() fitted equation.

all.vars

Logical. Should the new dataset contain all the variables from the original, or just a the selection used in the model? Defaults to TRUE.

key.variable

Name of the unique key variable (identifier variable). Only used if all.vars=FALSE.

Examples

1
2
mod <- lm(hp ~ disp, data=mtcars)
modelData(mod)

MichaelJMahometa/SDSRegressionR documentation built on March 3, 2021, 10:51 p.m.