piecewise_summ_figure: Piecewise linear figure

View source: R/piecewise_new.R

piecewise_summ_figureR Documentation

Piecewise linear figure

Description

piecewise_figure plots the piecewise linear function.

Usage

piecewise_summ_figure(
  xcoef,
  coef,
  xmean,
  lci,
  uci,
  xbreaks,
  family = "gaussian",
  ref = mean(xmean),
  pref_x = "x",
  pref_x_ref = "x",
  pref_y = "y",
  breaks = NULL,
  ci_fig = "point"
)

Arguments

xcoef

the association between the exposure and the instrument.

coef

the coefficients of the localized causal effects.

xmean

mean of each x stratum (for plotting point estimates)

lci

upper confidence interval range for each causal effects

uci

upper confidence interval range for each causal effects.

xbreaks

breakpoints in x (for plotting line estimates)

family

a description of the error distribution and link function to be used in the model. This is a character string naming either the gaussian (i.e. "gaussian" for continuous data) or binomial (i.e. "binomial" for binary data) family function.

ref

the reference point for the figure. This is the value of the that represents the expected difference in the outcome compared with this reference value when the exposure is set to different values. The default is the mean of x.

pref_x

the prefix/label for the x-axis. The default is "x".

pref_x_ref

the prefix for the reference value displayed on the y-axis. The default is "x".

pref_y

the prefix/label for the y-axis. The default is "y".

breaks

breaks on the y-axis of the figure.

ci_fig

point confidence intervals, or as ribbon ("point" or "ribbon")

Value

the plot of the piecewise linear function.

Author(s)

Amy Mason am2609@medschl.cam.ac.uk, leaning on work by James Statley and Matt Arnold


amymariemason/SUMnlmr documentation built on July 22, 2024, 10:03 a.m.