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):
head(ContinuousOutcome$PhenoData)
hima.fit <- hima_classic(
X = ContinuousOutcome$PhenoData$Treatment,
Y = ContinuousOutcome$PhenoData$Outcome,
M = ContinuousOutcome$Mediator,
COV.XM = ContinuousOutcome$PhenoData[, 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):
head(BinaryOutcome$PhenoData)
hima.logistic.fit <- hima_classic(
X = BinaryOutcome$PhenoData$Treatment,
Y = BinaryOutcome$PhenoData$Disease,
M = BinaryOutcome$Mediator,
COV.XM = BinaryOutcome$PhenoData[, 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