eta_vs_contcov: Eta continuous covariate plots (typical)

View source: R/covariates.R

eta_vs_contcovR Documentation

Eta continuous covariate plots (typical)

Description

Eta continuous covariate plots (typical)

Usage

eta_vs_contcov(
  xpdb,
  mapping = NULL,
  etavar = NULL,
  covvar = NULL,
  drop_fixed = TRUE,
  linsm = FALSE,
  type = "ps",
  list = TRUE,
  title = "Eta versus continuous covariates | @run",
  subtitle = "Based on @nind individuals, Eta shrink: @etashk",
  caption = "@dir",
  tag = NULL,
  log = NULL,
  guide = TRUE,
  facets,
  .problem,
  quiet,
  ...
)

Arguments

xpdb

<⁠xp_xtras> or <⁠xpose_data'> object

mapping

ggplot2 style mapping

etavar

tidyselect for eta variables

covvar

tidyselect for continuous covariate variables; NULL (default) selects every continuous covariate in the xpdb data index.

drop_fixed

As in xpose

linsm

If type contains "s" should the smooth method by lm?

type

Passed to xplot_scatter

list

<logical> Only relevant when etavar resolves to more than one eta. If TRUE (default, for backwards compatibility), returns a plain list of one plot per eta. If FALSE, all etas are instead combined onto one shared plot – faceted by eta, in addition to the existing per-covariate facet – automatically paginating (at most 9 panels per page, i.e. ncol/nrow of 3) via xpose's own facet_wrap_paginate mechanism. Printing the returned plot renders every page; pass page to print() to select a specific one.

title

Plot title

subtitle

Plot subtitle

caption

Plot caption

tag

Plot tag

log

Log scale covariate value?

guide

Add guide line?

facets

Additional facets

.problem

Problem number

quiet

Silence output

...

Any additional aesthetics.

Value

The desired plot, or (when etavar resolves to more than one eta and list = TRUE) a plain list of one plot per eta.

Examples



eta_vs_contcov(xpdb_x)

# Labels and units are also supported
xpdb_x %>%
  xpose::set_var_labels(AGE="Age", MED1 = "Digoxin") %>%
  xpose::set_var_units(AGE="yrs") %>%
  set_var_levels(SEX=lvl_sex(), MED1 = lvl_bin()) %>%
  eta_vs_contcov()

# Combine all etas onto one shared, faceted plot instead of a list
eta_vs_contcov(xpdb_x, list = FALSE)

# Restrict to specific covariates with covvar, just like etavar
eta_vs_contcov(xpdb_x, covvar = AGE)


xpose.xtras documentation built on Sept. 1, 2026, 5:08 p.m.