Learn R Programming

speccurvieR (version 1.0.0)

plot_samplesizes: Plots the number of observations across model specifications.

Description

plot_samplesizes() plots `n_obs`, the number of observations each specification was fit on, against the specification index. It makes visible whether specifications were fit on different samples -- with default listwise deletion they often are -- which is a reason to consider `sca(common_sample = TRUE)`.

Usage

plot_samplesizes(sca_data, title = "")

Value

A ggplot object.

Arguments

sca_data

A data frame returned by `sca()` containing model estimates from the specification curve analysis.

title

A string to use as the plot title. Defaults to an empty string, `""`.

See Also

[sca()] and its `common_sample` argument.

Examples

Run this code
plot_samplesizes(sca(y = "Salnty", x = "T_degC",
                     controls = c("ChlorA", "O2Sat", "NO2uM"),
                     data = bottles, progress_bar = FALSE, parallel = FALSE))

Run the code above in your browser using DataLab