# NOT RUN {
# Fit 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_ndfa)
dat <- dat_p_ndfa$dat
fit <- p_ndfa(
g = dat$g,
y = dat$numcases,
xtilde = dat$x,
c = dat$c,
errors = "neither",
constant_or = FALSE
)
# Plot estimated log-OR vs. X, holding C fixed at the sample mean.
p <- plot_ndfa(
estimates = fit$estimates,
varcov = fit$theta.var,
xrange = range(dat$x[dat$g == 1]),
cvals = mean(dat$c / dat$g)
)
p
# }
Run the code above in your browser using DataLab