test_ushape_cox: Test U-shape relationship This function checks for a U-shaped...

View source: R/cox.R

test_ushape_coxR Documentation

Test U-shape relationship This function checks for a U-shaped relationship between survival time and a set of variables. Users are required to create and set the datadist option globally before using this function.

Description

Test U-shape relationship This function checks for a U-shaped relationship between survival time and a set of variables. Users are required to create and set the datadist option globally before using this function.

Usage

test_ushape_cox(my_data, variables)

Arguments

my_data

A dataframe containing the data with survival times and event indicators.

variables

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

Value

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

Examples


library(rms)

data_path <- system.file("extdata", "cox_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_cox(my_data, c("u1", "u2"))



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

Related to test_ushape_cox in RGS...