Description Usage Arguments Details Value See Also Examples
View source: R/analyze_individually.R
An accessory function for estimate.wqs()
. Performs individual chemical analyses to determine the constraint for the overall mixture effect on the outcome (β_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.
1 2 3 4 5 6 7 |
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. |
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, β_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.
A data-frame from statistics of individual chemical analyses is returned:
name of the component
the estimate of log chemical effect
the standard error of log chemical effect
Model Fit. See stats::AIC
.
Other wqs:
coef.wqs()
,
do.many.wqs()
,
estimate.wqs.formula()
,
estimate.wqs()
,
make.quantile.matrix()
,
plot.wqs()
,
print.wqs()
1 2 3 4 5 6 7 8 9 | # 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.
|
Chemical.Name Estimate Std.Error AIC
1 alpha-chlordane 0.128 0.018 1315.527
2 dieldrin 0.176 0.033 1339.606
3 gamma-chlordane 1.310 0.192 1319.118
4 lindane 0.817 0.139 1332.276
5 methoxychlor 1.056 0.150 1315.461
6 dde 0.169 0.025 1319.293
7 ddt 0.176 0.086 1365.064
8 pentachlorophenol 0.245 0.081 1360.018
9 pcb_105 -0.026 0.051 1368.984
10 pcb_118 0.332 0.072 1347.162
11 pcb_138 0.356 0.056 1325.112
12 pcb_153 0.308 0.046 1321.903
13 pcb_170 0.404 0.087 1346.696
14 pcb_180 0.311 0.059 1339.602
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.