knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(predictr)
library(dplyr)
library(ggplot2)

estimate.R

FPF <- .2
TPF <- .85
getLRatios(FPF, TPF)
ggplot()+
  geom_point(aes(x = FPF, y = TPF)) +
  geom_line(data = getIsoOR(TPF, FPF), aes(x = FPF, y = TPF)) +
  geom_abline(data = getIsoLR(TPF, FPF), aes(intercept = intercept, slope = slope)) +
  geom_abline(intercept = 0, slope = 1, colour = "grey") +
  coord_cartesian(xlim = c(0,1), ylim = c(0,1), expand = F) + 
  theme_bw()
getPredValues(FPF, TPF) %>%
  ggplot(aes(x = prior, y = posterior, group = type)) +
  geom_line() +
  theme_bw()


c-marc/predictr documentation built on Dec. 19, 2021, 12:52 p.m.