Comp.Mix {CompMix} | R Documentation |
A comprehensive toolkit for environmental mixtures analysis
Description
A comprehensive toolkit for environmental mixtures analysis
Usage
Comp.Mix(
y,
x,
z = NULL,
y.type,
test.pct = 0.5,
var.select = NULL,
interaction = NULL,
interaction.exp.cov = NULL,
covariates.forcein = NULL,
bkmr.pip = 0.5,
bkmr.iter = 500,
formula = NULL,
expnms = NULL,
seed = 1234,
verbose = TRUE
)
Arguments
y |
A vector of either continuous or binary values to indicate the health outcome |
x |
A matrix of numeric values to indicate the chemical mixtures |
z |
A matrix of numeric values to indicate the covariates |
y.type |
A character value of either "continuous" or "binary" |
test.pct |
A numeric scalar between 0 and 1 to indicate the proportion allocated as test samples |
var.select |
A logical value to indicate whether to perform variable selection |
interaction |
A logical value (TRUE/FALSE) to indicate whether to include pairwise interaction terms between all the chemical mixtures x |
interaction.exp.cov |
A logical value (TRUE/FALSE) to indicate whether to include pairwise interaction terms between all the chemical mixtures x and covariates z. If interaction.exp.cov=TRUE, interaction=TURE or interaction=FALSE will be ignored |
covariates.forcein |
A logical value (TRUE/FALSE) to indicate whether to force in any covariates |
bkmr.pip |
A numeric scalar between 0 and 1 to indicate the cutoff for the posterior inclusion probability in BKMR |
bkmr.iter |
A positive integer to indicate the number of MCMC iterations for bkmr |
formula |
the formula for qgcomp and wqs |
expnms |
a vector of characters for names of exposure variables |
seed |
an integer value for seed |
verbose |
a logical value to show information |
Value
A list object which may contain up to 8 cases
- Case 1
variable selection on main effects for exposures and confounders
Each case may contain some of the following elements
- betaest
a numeric vector of coeffcients for the exposures
- z_betaest
a numeric vector of coeffcients for the covariates
- sse
A positive scalar to indicate sum of squares error
- corr
A numeric scalar between -1 and 1 to indicate correlation coefficient
Author(s)
Wei Hao <weihao@umich.edu>
Examples
dat <- lmi_simul_dat(n=1000,p=20,q=5,
block_idx=c(1,1,2,2,3,1,1,1,1,1,2,2,2,2,3,3,3,3,3,3),
within_rho=0.6,btw_rho=0.1,R2=0.2,
effect_size=1,effect_size_i=1,
cancel_effect = FALSE)
#Example 1: The users would like to perform variable selections
#on main effects of exposures and covariates, and outcome, exposures and
#covariates are entered. For any individual interactions that the users would
#like to include in the models, they can add those into the covariate z.
res_ex1 <- Comp.Mix(y.type="continuous",y=dat$y, x=dat$x, z=dat$z, test.pct=0.5,
var.select = TRUE, interaction = FALSE, interaction.exp.cov = FALSE,
covariates.forcein = FALSE,
bkmr.pip=0.5, seed=2023)