R/CADF_to_logistic_regression.R

Defines functions CADF_to_logistic_regression

Documented in CADF_to_logistic_regression

#' @title CADF to logistic regression
#' @description
#' Convert a CADF dataset to a dataset for logistic regression
#' 
#' @export CADF_to_logistic_regression
#' @param CADF CADF-formatted dataset
CADF_to_logistic_regression <- function(CADF) {
  a <- lapply(CADF, function(x) x$logistic_modeling_matrix)
  logistic.data <- do.call(rbind, a)
  logistic.data <- data.frame(logistic.data)
  colnames(logistic.data) <- c("T", "cancel")
  logistic.data
}

Try the CADF package in your browser

Any scripts or data that you put into this service are public.

CADF documentation built on Oct. 31, 2024, 5:08 p.m.