# NOT RUN {
# load lodi's toy data
library(lodi)
data("toy_data")
lodi.out <- lod_root2(case_cntrl ~ poll + smoking + gender, toy_data, lod,
logistic)
# see the fit model
lodi.out$model
# we can log transform poll to make it normally distributed
lodi.out <- lod_root2(case_cntrl ~ log(poll) + smoking + gender, toy_data,
lod, logistic)
lodi.out$model
# transforming the exposure results in a new column being added to data,
# representing the transformed lod.
head(lodi.out$data)
# You can even define your own transformation functions and use them
f <- function(x) exp(sqrt(x))
lodi.out <- lod_root2(case_cntrl ~ f(poll) + smoking + gender, toy_data, lod,
logistic)
head(lodi.out$data)
# }
Run the code above in your browser using DataLab