plot.wqs: Histograms of the Weights, Beta1, and WQS using 'ggplot'

Description Usage Arguments Details Value Note See Also Examples

View source: R/plot_wqs_ggplot2_helper.R

Description

Plots a WQS object producing three histograms of the weights, the overall chemical effect, and WQS across bootstraps. These histograms are returned as ggplot2 objects.

Usage

1
2
## S3 method for class 'wqs'
plot(x, ...)

Arguments

x

An object of class "wqs", usually as a result of estimate.wqs.

...

Further arguments passed from other methods. Currently has no effect.

Details

Three histograms are produced using geom_histogram with ten bins.

Once a Weighted Quantile Sum (WQS) regression is run, the hist.weights is a panel of histograms. These are distributions of the weight estimates to determine which chemicals are important in the mixture. Each weight is between 0 and 1 and sum to 1. The individual bootstrapped weight estimates were used to construct the overall chemical index, WQS.

The hist.beta1 is the distribution of the overall effect of the mixture on the outcome across bootstraps in the training dataset. Due to the constraint in WQS regression, these estimates are either all positive or all negative as dictated by b1.pos() argument in estimate.wqs. The patterns detected here might be helpful in adjusting the signal function, which is controlled by signal.fn() argument in estimate.wqs.

Value

A list of histograms

hist.weights

A list of ggplot2 histogram of weights across the bootstrap. Each component consists of a histogram with a weight estimate.

hist.beta1

A histogram of the overall chemical mixture effect. This parameter is constrained to be positive if the b1.pos argument in estimate.wqs() is TRUE.; otherwise, it is FALSE.

hist.WQS

A histogram of the overall chemical sum, WQS. Due to constraints, it is always between 0 and n.quantiles-1.

Note

Defunct argument filename has been removed. Plots are no longer saved automatically; please save manually using ggsave().

See Also

Other wqs: analyze.individually(), coef.wqs(), do.many.wqs(), estimate.wqs.formula(), estimate.wqs(), make.quantile.matrix(), print.wqs()

Examples

1
2
3
4
5
6
# Use simulated dataset and set seed for reproducibility.
data(simdata87)
set.seed(23456)
Wa <- estimate.wqs(y = simdata87$y.scenario, X = simdata87$X.true[, 1:6],
  B = 10, family = "binomial")
plot(Wa)

miWQS documentation built on April 3, 2021, 1:06 a.m.