Learn R Programming

Surrogate (version 3.3.3)

marginal_gof_copula: Produce marginal GoF plot

Description

Produce marginal GoF plot

Usage

marginal_gof_copula(
  marginal,
  observed,
  name,
  type,
  treat,
  return_data = FALSE,
  grid = NULL,
  ...
)

Arguments

marginal

Estimated marginal distribution represented by a list with three elements in the following order: the estimated cdf, pdf, and inverse cdf.

observed

Observed values. These are used for the histogram.

name

Name of the endpoint (used in the plot title).

type

Type of endpoint: "ordinal" or "continuous"

treat

Value for the treatment indicator.

return_data

(boolean) Return the data used in the goodness-of-fit plot (without the plot itself). This is useful when the user wants to customize the plots, e.g., using ggplot2. See Details.

grid

(numeric) vector of values for the endpoint at which the model-based density is computed.

...

Extra arguments passed onto plot() or hist() for an ordinal and continuous endpoint, respectively.

Return Plotting Data

If return_data is TRUE, this function will return a data frame that can be used to create customized plots. The following variables are present in the returned data frame:

  • observed: The empirical proportions (type = "ordinal"). NA for type = "continuous".

  • upper_ci, lower_ci: Upper limit of the 95% confidence interval for the empirical proportions. Defaults to NA if type = "continuous".

  • value: Value for the continuous or ordinal variable.

  • model_based: Estimated model-based density (type = "continuous") or proportions (type = "ordinal")

See Also

plot.vine_copula_fit()