# NOT RUN {
# Fit Gamma discriminant function model for poolwise X vs. (Y, C), without
# assuming a constant log-OR. Note that data were generated with a constant
# log-OR of 0.5.
data(dat_p_gdfa)
dat <- dat_p_gdfa$dat
c.list <- dat_p_gdfa$c.list
fit <- p_gdfa(
g = dat$g,
y = dat$y,
xtilde = dat$x,
c = c.list,
errors = "neither",
constant_or = FALSE
)
# Plot estimated log-OR vs. X, holding C fixed at the sample mean.
p <- plot_gdfa(
estimates = fit$estimates,
varcov = fit$theta.var,
xrange = range(dat$x[dat$g == 1]),
cvals = mean(unlist(c.list))
)
p
# }
Run the code above in your browser using DataLab