Learn R Programming

MTAFT (version 0.1.0)

MTAFT_test: Perform score-type test for the presence of threshold effect in multi-threshold situations.

Description

This function performs a score-type test statistics for the presence of threshold effect in multi-threshold situations.

Usage

MTAFT_test(Y, X, Tq, delta, nboots)

Value

p-value result indicating the presence of threshold effect.

Arguments

Y

Response variable.

X

Covariates.

Tq

Threshold variable.

delta

Indicator vector for censoring.

nboots

Number of bootstrap iterations.

Examples

Run this code
# \donttest{
# Generate simulated data with 500 samples and normal error distribution
dataset <- MTAFT_simdata(n = 500, err = "normal")
Y <- dataset[, 1]
delta <- dataset[, 2]
Tq <- dataset[, 3]
X <- dataset[, -c(1:3)]

# Perform score-type test with 500 bootstraps
pval <- MTAFT_test(Y, X, Tq, delta, nboots = 500)

# Perform score-type test with 1000 bootstraps
pval <- MTAFT_test(Y, X, Tq, delta, nboots = 1000)
# }

Run the code above in your browser using DataLab