rgs_for_logistic: Main function for logistic regression analysis

View source: R/logistic.R

rgs_for_logisticR Documentation

Main function for logistic regression analysis

Description

This function performs logistic regression analysis to identify optimal cutoffs and evaluate the model. Users are required to create and set the datadist option globally before using this function.

Usage

rgs_for_logistic(my_data, u_variables, covariates)

Arguments

my_data

A dataframe containing the data.

u_variables

A character vector specifying the names of the U-shaped variables.

covariates

A character vector specifying the names of the covariates.

Value

A dataframe containing the best combination of cutoffs and associated AIC value.

Examples


library(rms)

data_path <- system.file("extdata", "logistic_data.csv", package = "RGS")
my_data <- read.csv(data_path)

# Define variables
u_variables <- c("u1", "u2")
covariates <- c("l1", "c1")

# create and set the datadist option globally
dd <- datadist(my_data)
options(datadist = "dd")

rgs_for_logistic(my_data, u_variables, covariates)



RGS documentation built on April 4, 2025, 1:08 a.m.

Related to rgs_for_logistic in RGS...