res_cat: Plot residuals versus categorical variable

View source: R/res_cat.R

res_catR Documentation

Plot residuals versus categorical variable

Description

These are vectorized functions. See details.

Usage

res_cat(df, x, y = pm_axis_res(), hline = 0, ...)

wres_cat(df, x, y = pm_axis_wres(), hline = 0, ...)

cwres_cat(df, x, y = pm_axis_cwres(), hline = 0, ...)

cwresi_cat(df, x, y = pm_axis_cwresi(), ...)

npde_cat(df, x, y = pm_axis_npde(), ...)

Arguments

df

data frame to plot

x

character col//title for x-axis data; see col_label

y

character col//title for y-axis data; see col_label

hline

where to draw horizontal reference line

...

passed to cont_cat

Details

These are vectorized functions; if either x or y are a character vector (in col//title format), a list of plots is returned. If both x and y are length 1, then a single plot object (not a list) is returned.

Since this function creates a boxplot, the x column must be character, factor or logical and y column must be numeric.

Summary numbers located below each box are described in boxwork. The summaries will not be correct if the plot is eventually faceted by another variable in the data set. In this case, either use shown=FALSE or create the plot with split_plot.

Value

A single plot when a single value for x and y are supplied; a list of plots of either x or y have length greater than 1.

See Also

boxwork, cont_cat

Examples


df <- pmplots_data_obs()

cwresi_cat(df, x="STUDYc//Study name")


metrumresearchgroup/pmplots documentation built on Oct. 15, 2024, noon