test_ushape_logistic: Test U-shape relationship in logistic regression

View source: R/logistic.R

test_ushape_logisticR Documentation

Test U-shape relationship in logistic regression

Description

This function plots the estimated relationship between the response variable and a set of predictor variables to identify potential U-shaped patterns. Users are required to create and set the datadist option globally before using this function.

Usage

test_ushape_logistic(my_data, variables)

Arguments

my_data

A dataframe containing the data with response and predictor variables.

variables

A character vector specifying the names of the predictor variables to be tested.

Value

No return value, produces a plot as a side effect.

Examples


library(rms)

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

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

test_ushape_logistic(my_data, c("u1", "u2"))



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