# NOT RUN {
# Data frame with two batches
# Batch 2 has higher values of biomarker and confounder
df <- data.frame(
tma = rep(1:2, times = 10),
biomarker = rep(1:2, times = 10) +
runif(max = 5, n = 20),
confounder = rep(0:1, times = 10) +
runif(max = 10, n = 20)
)
# Adjust for batch effects
df2 <- adjust_batch(
data = df,
markers = biomarker,
batch = tma,
method = quantreg,
confounders = confounder
)
# Show overview of model diagnostics:
diagnose_models(data = df2)
# Obtain first fitted regression model:
fit <- diagnose_models(data = df2)$model_fits[[1]][[1]]
# Obtain residuals for this model:
residuals(fit)
# }
Run the code above in your browser using DataLab