Learn R Programming

miWQS (version 0.4.4)

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

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

# S3 method for 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.

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.

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.

See Also

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

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab