si.fun.plot: Plot estimated single index function

View source: R/si.fun.plot.R

si.fun.plotR Documentation

Plot estimated single index function

Description

Plot estimated single index function

Usage

si.fun.plot(
  si.ci,
  type = c("linear", "logistic", "log"),
  xlab = "Single index: u",
  ylab = NULL
)

Arguments

si.ci

A data set of estimated index and corresponding single index values, typically the si.fun element returned by plsi.lr.auto(), plsi.logistic.auto(), or plsi.log.auto() (or the analogous plsi.lr.v2() output for the linear case).

type

Which outcome scale to plot. "linear" (default) plots the predicted outcome g(u) using the fit/lwr/upr columns, as returned for a continuous outcome. "logistic" plots the predicted probability using the prob.fit/prob.lwr/ prob.upr columns returned by plsi.logistic.auto(), with the y-axis bounded between 0 and 1. "log" plots the predicted count using the count.fit/count.lwr/count.upr columns returned by plsi.log.auto(), with the y-axis bounded below at 0.

xlab

X-axis label. Default "Single index: u".

ylab

Y-axis label. If NULL (default), a label appropriate to type is used automatically.

Value

Single index function plot

Author(s)

Yuyan Wang

Examples

## Not run: 
# example to plot estimated single index function of continuous outcome
data(nhanes.new)
data <- nhanes.new

Y.name <- "log.triglyceride"
X.name <- c("X1_trans.b.carotene", "X2_retinol", "X3_g.tocopherol", "X4_a.tocopherol",
            "X5_PCB99", "X6_PCB156", "X7_PCB206",
            "X8_3.3.4.4.5.pncb", "X9_1.2.3.4.7.8.hxcdf", "X10_2.3.4.6.7.8.hxcdf")
Z.name <- c("AGE.c", "SEX.Female", "RACE.NH.Black",
           "RACE.MexicanAmerican", "RACE.OtherRace", "RACE.Hispanic" )

k <- 10
bs <- "cr"
initial.random.num <- 1
seed = 2026

model_lr_auto <- plsi.lr.auto(data = data, Y.name = Y.name, X.name = X.name, Z.name = Z.name,
                      k = k, bs = bs, initial.random.num = initial.random.num, seed = seed)
# plot single index function of predicted (continuous) outcome
si.fun.plot(model_lr_auto$si.fun, type = "linear")

## End(Not run)

EPLSIM documentation built on Nov. 5, 2026, 1:08 a.m.