binary_calibration_plot: Binary Calibration Plots

Description Usage Arguments Value Examples

View source: R/calib_plot.R

Description

Binary Calibration Plots

Usage

1
2
binary_calibration_plot(response, model, breaks = 0:10/10,
  point.color = "blue", line.color = "red")

Arguments

response

The response variable from the data

model

A model object

breaks

The number of bins used to create the error bars that will be displayed

point.color

The color of the points in the scatterplot

line.color

The color of the line y = x

Value

A ggplot2 object

Examples

1
2
3
4
5
6
7
ch <- read.csv("http://www.stat.cmu.edu/~cshalizi/uADA/15/hw/06/ch.csv")
ch.clean <- na.omit(ch)
lr.ch <- glm(start ~ . -country -year +I(exports^2), data=ch, family="binomial") # logistic regression
binary_calibration_plot(y = ch.clean$start, model = lr.ch, breaks = 0:7/10, point.color = "blue", line.color = "red")
library(mgcv)
gam.ch <- gam(start~s(exports)+s(schooling)+s(growth)+s(peace)+s(concentration)+s(lnpop)+s(fractionalization)+dominance, # GAM
binary_calibration_plot(ch.clean$start, gam.ch, breaks=0:9/10, blue, red)

joestoica/STAT-S-432-Package documentation built on Nov. 4, 2019, 3:04 p.m.