analyze.individually {miWQS} | R Documentation |
Performing Individual Chemical Analysis
Description
An accessory function for estimate.wqs()
. Performs individual chemical analyses to determine the constraint for the overall mixture effect on the outcome (\beta_1
) in WQS regression. After adjusting for any covariates, the outcome regresses on each chemical individually. Returns a data-frame of statistics from these analyses.
Usage
analyze.individually(
y,
X,
Z = NULL,
family = c("gaussian", "binomial", "poisson"),
offset = NULL
)
Arguments
y |
Outcome: numeric vector or factor. Assumed to be complete, and missing outcomes are ignored. Assumed to follow an exponential family distribution given in |
X |
Components/chemicals to be combined into an index; a numeric matrix or data-frame. |
Z |
Any covariates used. Ideally, a numeric matrix, but Z can be a factor, vector or data-frame. Assumed to be complete; observations with missing covariate values are ignored with a warning printed. If none, enter NULL. |
family |
The distribution of outcome y. A character value:
if equal to "gaussian" a linear model is implemented;
if equal to "binomial" a logistic model is implemented;
if equal to "poisson", a log-link (rate or count) model is implemented.
See |
offset |
The at-risk population used as a numeric vector of length equal to the number of subjects when modeling rates in Poisson regression. Passed to glm2. Default: If there is no offset, enter NULL. |
Details
Individual chemical analyses with the outcome can be used to determine whether the mixture of chemicals is positively or negatively related to the outcome. The constraint whether the overall mixture effect, \beta_1
, is positive or negative is controlled by b1.pos argument in estimate.wqs
. The b1.pos argument is TRUE if the overall chemical mixture effect is positively related to the outcome; otherwise, it is negatively related to the outcome.
For each analysis, the outcome is regressed on the log of the observed values for each chemical and any other covariates Z, if they exist. This was accomplished using glm2
. We summarized the results by recording the chemical name, estimating the log chemical effect and its standard error on the outcome, and using the Akaike Information Criterion (AIC) to indicate model fit.
By looking at the output, one can decide whether the chemical mixture is positive or negative. Generally, if the sign of estimates is mainly positive, we would decide to make b1.pos in estimate.wqs
to be TRUE. This is just one approach to determine the direction of this constraint. Alternatively, one can conduct a WQS analysis for the positively related chemicals and another WQS analysis for the negatively related chemicals.
Value
A data-frame from statistics of individual chemical analyses is returned:
- chemical.name
name of the component
- estimate
the estimate of log chemical effect
- Std.Error
the standard error of log chemical effect
- AIC
Model Fit. See
stats::AIC
.
See Also
Other wqs:
coef.wqs()
,
do.many.wqs()
,
estimate.wqs.formula()
,
estimate.wqs()
,
make.quantile.matrix()
,
plot.wqs()
,
print.wqs()
Examples
# Binomial Example
data("simdata87")
analyze.individually(
y = simdata87$y.scenario, X = simdata87$X.true, Z = simdata87$Z.sim,
family = "binomial"
)
# The "Estimate" column contains the log_odds of each log of the
# chemical on the outcome. Most are positive, which indicates a possible
# positive relationship between mixture of chemicals and the outcome.