if (FALSE) {
# Note: In the following examples, M1, M2, and M3 are true mediators.
# When Y is continuous and normally distributed
# Example 1 (continuous outcome):
data(ContinuousOutcome)
pheno_data <- ContinuousOutcome$PhenoData
mediator_data <- ContinuousOutcome$Mediator
hima.fit <- hima_classic(
X = pheno_data$Treatment,
Y = pheno_data$Outcome,
M = mediator_data,
COV.XM = pheno_data[, c("Sex", "Age")],
Y.type = "continuous",
scale = FALSE, # Disabled only for simulation data
verbose = TRUE
)
hima.fit
# When Y is binary
# Example 2 (binary outcome):
data(BinaryOutcome)
pheno_data <- BinaryOutcome$PhenoData
mediator_data <- BinaryOutcome$Mediator
hima.logistic.fit <- hima_classic(
X = pheno_data$Treatment,
Y = pheno_data$Disease,
M = mediator_data,
COV.XM = pheno_data[, c("Sex", "Age")],
Y.type = "binary",
scale = FALSE, # Disabled only for simulation data
verbose = TRUE
)
hima.logistic.fit
}
Run the code above in your browser using DataLab