AddDummyVariablesForNAs: Add dummy variables to a 'data.frame' suitable for regression...

View source: R/missingdata.R

AddDummyVariablesForNAsR Documentation

Add dummy variables to a data.frame suitable for regression models.

Description

Appends a matrix to a data.frame containing columns of dummy variables. It assumes the input data is suitable for regression and contains a single column for an outcome variable. Other columns would be for individual predictors used in the regression. The appended columns of dummy variables indicate the missing status of each predictor. i.e. 1 if the predictor is missing in that case, zero otherwise. A column is added for each predictor that has at least one case of missing data.

Usage

AddDummyVariablesForNAs(data, outcome.name, checks = TRUE)

Arguments

data

A data.frame of the data to be used for a Regression model assuming a single outcome.

outcome.name

A characater of the name of the outcome variable in the data.

checks

A logical to determine if further checks are done to remove cases from the data. If TRUE, cases are removed if all predictors are missing or if the response is missing.


Displayr/flipData documentation built on March 2, 2024, 3:49 a.m.