CSSS 569 Visualizing Data and Models Lab 5: Intro to tile Kai Ping - - PowerPoint PPT Presentation

csss 569 visualizing data and models
SMART_READER_LITE
LIVE PREVIEW

CSSS 569 Visualizing Data and Models Lab 5: Intro to tile Kai Ping - - PowerPoint PPT Presentation

CSSS 569 Visualizing Data and Models Lab 5: Intro to tile Kai Ping (Brian) Leung Department of Political Science, UW February 7, 2020 Introduction Overview of tile Introduction Overview of tile Preview of three examples


slide-1
SLIDE 1

CSSS 569 Visualizing Data and Models

Lab 5: Intro to tile Kai Ping (Brian) Leung

Department of Political Science, UW

February 7, 2020

slide-2
SLIDE 2

Introduction

◮ Overview of tile

slide-3
SLIDE 3

Introduction

◮ Overview of tile ◮ Preview of three examples

slide-4
SLIDE 4

Introduction

◮ Overview of tile ◮ Preview of three examples

◮ Scatterplot: HW1 example

slide-5
SLIDE 5

Introduction

◮ Overview of tile ◮ Preview of three examples

◮ Scatterplot: HW1 example ◮ Expected probabilities and first differences: Voting example

slide-6
SLIDE 6

Introduction

◮ Overview of tile ◮ Preview of three examples

◮ Scatterplot: HW1 example ◮ Expected probabilities and first differences: Voting example ◮ Ropeladder: Crime example

slide-7
SLIDE 7

Introduction

◮ Overview of tile ◮ Preview of three examples

◮ Scatterplot: HW1 example ◮ Expected probabilities and first differences: Voting example ◮ Ropeladder: Crime example

◮ Installing tile and simcf

slide-8
SLIDE 8

Introduction

◮ Overview of tile ◮ Preview of three examples

◮ Scatterplot: HW1 example ◮ Expected probabilities and first differences: Voting example ◮ Ropeladder: Crime example

◮ Installing tile and simcf ◮ Walking through examples

slide-9
SLIDE 9

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment

slide-10
SLIDE 10

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

slide-11
SLIDE 11

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots

slide-12
SLIDE 12

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders

slide-13
SLIDE 13

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model

slide-14
SLIDE 14

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model ◮ Avoid extrapolation from the original data underlying your model

slide-15
SLIDE 15

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model ◮ Avoid extrapolation from the original data underlying your model ◮ Fully control titles, annotation, and layering of graphical elements

slide-16
SLIDE 16

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model ◮ Avoid extrapolation from the original data underlying your model ◮ Fully control titles, annotation, and layering of graphical elements ◮ Build your own tiled graphics from primitives

slide-17
SLIDE 17

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model ◮ Avoid extrapolation from the original data underlying your model ◮ Fully control titles, annotation, and layering of graphical elements ◮ Build your own tiled graphics from primitives

◮ Work well in combination with simcf package

slide-18
SLIDE 18

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model ◮ Avoid extrapolation from the original data underlying your model ◮ Fully control titles, annotation, and layering of graphical elements ◮ Build your own tiled graphics from primitives

◮ Work well in combination with simcf package

◮ Calculate counterfactual expected values, first differences, and relative risks, and their confidence intervals

slide-19
SLIDE 19

Overview of tile

◮ A fully featured R graphics package built on the grid graphics environment ◮ Features:

◮ Make standard displays like scatterplots, lineplots, and dotplots ◮ Create more experimental formats like ropeladders ◮ Summarize uncertainty in inferences from model ◮ Avoid extrapolation from the original data underlying your model ◮ Fully control titles, annotation, and layering of graphical elements ◮ Build your own tiled graphics from primitives

◮ Work well in combination with simcf package

◮ Calculate counterfactual expected values, first differences, and relative risks, and their confidence intervals ◮ More later

slide-20
SLIDE 20

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

slide-21
SLIDE 21

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

slide-22
SLIDE 22

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon

slide-23
SLIDE 23

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon ◮ Could be a set of points and symbols, colors, labels, fit line, CIs, and/or extrapolation limits

slide-24
SLIDE 24

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon ◮ Could be a set of points and symbols, colors, labels, fit line, CIs, and/or extrapolation limits ◮ Could be the data for a dotchart, with labels for each line

slide-25
SLIDE 25

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon ◮ Could be a set of points and symbols, colors, labels, fit line, CIs, and/or extrapolation limits ◮ Could be the data for a dotchart, with labels for each line ◮ Could be the marginal data for a rug

slide-26
SLIDE 26

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon ◮ Could be a set of points and symbols, colors, labels, fit line, CIs, and/or extrapolation limits ◮ Could be the data for a dotchart, with labels for each line ◮ Could be the marginal data for a rug ◮ All annotation must happen in this step

slide-27
SLIDE 27

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon ◮ Could be a set of points and symbols, colors, labels, fit line, CIs, and/or extrapolation limits ◮ Could be the data for a dotchart, with labels for each line ◮ Could be the marginal data for a rug ◮ All annotation must happen in this step ◮ Basic traces: linesTile(), pointsile(), polygonTile(), polylinesTile(), and textTile()

slide-28
SLIDE 28

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data traces: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

◮ Could be a set of points, or text labels, or lines, or a polygon ◮ Could be a set of points and symbols, colors, labels, fit line, CIs, and/or extrapolation limits ◮ Could be the data for a dotchart, with labels for each line ◮ Could be the marginal data for a rug ◮ All annotation must happen in this step ◮ Basic traces: linesTile(), pointsile(), polygonTile(), polylinesTile(), and textTile() ◮ Complex traces: lineplot(), scatter(), ropeladder(), and rugTile()

slide-29
SLIDE 29

Overview of tile

◮ Primitive trace functions:

◮ linesTile(): Plot a set of connected line segments ◮ pointsTile(): Plot a set of points ◮ polygonTile(): Plot a shaded region ◮ polylinesTile(): Plot a set of unconnected line segments ◮ textTile(): Plot text labels

◮ Complex traces for model or data exploration:

◮ lineplot(): Plot lines with confidence intervals, extrapolation warnings ◮ ropeladder(): Plot dotplots with confidence intervals, extrapolation warnings, and shaded ranges ◮ rugTile(): Plot marginal data rugs to axes of plots ◮ scatter(): Plot scatterplots with text and symbol markers, fit lines, and confidence intervals

slide-30
SLIDE 30

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

slide-31
SLIDE 31

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

slide-32
SLIDE 32

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

  • 2. Plot the data traces: Using the tile() function,

simultaneously plot all traces to all plots

slide-33
SLIDE 33

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

  • 2. Plot the data traces: Using the tile() function,

simultaneously plot all traces to all plots

◮ This is the step where the scaffolding gets made: axes and titles

slide-34
SLIDE 34

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

  • 2. Plot the data traces: Using the tile() function,

simultaneously plot all traces to all plots

◮ This is the step where the scaffolding gets made: axes and titles ◮ Set up the rows and columns of plots

slide-35
SLIDE 35

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

  • 2. Plot the data traces: Using the tile() function,

simultaneously plot all traces to all plots

◮ This is the step where the scaffolding gets made: axes and titles ◮ Set up the rows and columns of plots ◮ Titles of plots, axes, rows of plots, columns of plots, etc.

slide-36
SLIDE 36

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

  • 2. Plot the data traces: Using the tile() function,

simultaneously plot all traces to all plots

◮ This is the step where the scaffolding gets made: axes and titles ◮ Set up the rows and columns of plots ◮ Titles of plots, axes, rows of plots, columns of plots, etc. ◮ Set up axis limits, ticks, tick labels, logging of axes

slide-37
SLIDE 37

Overview of tile

◮ Three steps to make tile plots (from Chris’s “Tufte Without Tears”)

  • 1. Create data trace: Each trace contains the data and

graphical parameters needed to plot a single set of graphical elements to one or more plots

  • 2. Plot the data traces: Using the tile() function,

simultaneously plot all traces to all plots

◮ This is the step where the scaffolding gets made: axes and titles ◮ Set up the rows and columns of plots ◮ Titles of plots, axes, rows of plots, columns of plots, etc. ◮ Set up axis limits, ticks, tick labels, logging of axes

  • 3. Examine output and revise: Look at the graph made in step

2, and tweak the input parameters for steps 1 and 2 to make a better graph

slide-38
SLIDE 38

Three examples

◮ Scatterplot: HW1 example ◮ Expected probabilities and first differences: Voting example ◮ Ropeladder: Crime examples (if time permits)

slide-39
SLIDE 39

Scatterplot: HW 1 example

2 3 4 5 6 7 20 40 60 80

Party Systems and Redistribution

Effective number of parties % lifted from poverty by taxes & transfers

  • Australia

Belgium Canada Denmark Finland France Germany Italy Netherlands Norway Sweden Switzerland United Kingdom United States Majoritarian Proportional Unanimity

slide-40
SLIDE 40

Expected probabilities and first differences: Voting example

20 30 40 50 60 70 80 90 0.2 0.4 0.6 0.8 1 Age of Respondent Probability of Voting Less than HS High School College

Logit estimates: 95% confidence interval is shaded

slide-41
SLIDE 41

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

slide-42
SLIDE 42

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

slide-43
SLIDE 43

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . .

slide-44
SLIDE 44

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

slide-45
SLIDE 45

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

slide-46
SLIDE 46

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

slide-47
SLIDE 47

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

slide-48
SLIDE 48

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

◮ simcf::cfMake, cfChange. . .

slide-49
SLIDE 49

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

◮ simcf::cfMake, cfChange. . .

  • 4. Simulate quantities of interest by compounding those 10,000

˜ βk with counterfactual scenarios

slide-50
SLIDE 50

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

◮ simcf::cfMake, cfChange. . .

  • 4. Simulate quantities of interest by compounding those 10,000

˜ βk with counterfactual scenarios

◮ Then compute average (point estimate) and appropriate percentiles (confidence intervals)

slide-51
SLIDE 51

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

◮ simcf::cfMake, cfChange. . .

  • 4. Simulate quantities of interest by compounding those 10,000

˜ βk with counterfactual scenarios

◮ Then compute average (point estimate) and appropriate percentiles (confidence intervals) ◮ simcf::logitsimev() for expected values for logit models

slide-52
SLIDE 52

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

◮ simcf::cfMake, cfChange. . .

  • 4. Simulate quantities of interest by compounding those 10,000

˜ βk with counterfactual scenarios

◮ Then compute average (point estimate) and appropriate percentiles (confidence intervals) ◮ simcf::logitsimev() for expected values for logit models ◮ logitsimfd for first differences

slide-53
SLIDE 53

Scatterplot: HW 1 example

◮ A quick detour to model results presentation and the logic of simulation (consult POLS/CSSS 510:MLE::Topic 3)

  • 1. Obtain estimated parameters (ˆ

βk) and standard errors (more precisely, the variance-covariance matrix)

◮ lm(), glm(). . . ; coef(), vcov(). . . ◮ What you see in usual regression tables

  • 2. Capture our uncertainty around ˆ

βk by drawing, say, 10,000 ˜ βk from a multivariate normal distribution

◮ MASS::mvrnorm()

  • 3. Specify counterfactual scenarios (hypothetical values for all

relevant covariates xk)

◮ simcf::cfMake, cfChange. . .

  • 4. Simulate quantities of interest by compounding those 10,000

˜ βk with counterfactual scenarios

◮ Then compute average (point estimate) and appropriate percentiles (confidence intervals) ◮ simcf::logitsimev() for expected values for logit models ◮ logitsimfd for first differences ◮ logitsimrr for relative risks

slide-54
SLIDE 54

Expected probabilities and first differences: Voting example

20 30 40 50 60 70 80 90 0.2 0.4 0.6 0.8 1 Age of Respondent Probability of Voting Less than HS High School College

Logit estimates: 95% confidence interval is shaded

slide-55
SLIDE 55

Expected probabilities and first differences: Voting example

20 30 40 50 60 70 80 90 0.2 0.4 0.6 0.8 1 Age of Respondent Probability of Voting Currently Married Not Married

Logit estimates: 95% confidence interval is shaded

slide-56
SLIDE 56

Expected probabilities and first differences: Voting example

20 30 40 50 60 70 80 90 −0.1 0.1 0.2 0.3 0.4 0.5 Age of Respondent Difference in Probability of Voting 20 30 40 50 60 70 80 90 0.9 1 1.1 1.2 1.3 1.4 1.5 Age of Respondent Relative Risk of Voting Married compared to Not Married Logit estimates: 95% confidence interval is shaded Married compared to Not Married Logit estimates: 95% confidence interval is shaded

slide-57
SLIDE 57

Ropeladder: Crime example (if time permits)

−500 500 1000 0.5x 1x 1.5x 2x E(crime rate per 100,000) E(crime rate) / average Pr(Prison) +0.5 sd Police Spending +0.5 sd Unemployment (t−2) +0.5 sd Non−White Pop +0.5 sd Male Pop +0.5 sd Education +0.5 sd Inequality +0.5 sd

slide-58
SLIDE 58

Ropeladder: Crime example (if time permits)

−500 500 1000 0.5x 1x 1.5x 2x

Linear

E(crime rate per 100,000) E(crime rate) / average Pr(Prison) +0.5 sd Police Spending +0.5 sd Unemployment (t−2) +0.5 sd Non−White Pop +0.5 sd Male Pop +0.5 sd Education +0.5 sd Inequality +0.5 sd −500 500 1000 0.5x 1x 1.5x 2x

Robust

E(crime rate per 100,000) E(crime rate) / average −500 500 1000 0.5x 1x 1.5x 2x

Poisson

E(crime rate per 100,000) E(crime rate) / average −500 500 1000 0.5x 1x 1.5x 2x

Neg Bin

E(crime rate per 100,000) E(crime rate) / average

slide-59
SLIDE 59

−200 −100 100 200 300 400 0.75x 1x 1.25x 1.5x E(crime rate per 100,000) E(crime rate) / average Pr(Prison) +0.5 sd Police Spending +0.5 sd Unemployment (t−2) +0.5 sd Non−White Pop +0.5 sd Male Pop +0.5 sd Education +0.5 sd Inequality +0.5 sd

  • linear

linear linear linear linear linear linear robust robust robust robust robust robust robust poisson poisson poisson poisson poisson poisson poisson negbin negbin negbin negbin negbin negbin negbin

slide-60
SLIDE 60

Ropeladder: Crime example (if time permits)

−200 200 400 .75x 1x 1.25x 1.5x

Pr(Prison)

E(crime rate per 100,000) E(crime rate) / average Linear Robust & Resistant Poisson Negative Binomial −200 200 400 .75x 1x 1.25x 1.5x

Police Spending

E(crime rate per 100,000) E(crime rate) / average −200 200 400 .75x 1x 1.25x 1.5x

Unemployment

E(crime rate per 100,000) E(crime rate) / average −200 200 400 .75x 1x 1.25x 1.5x

Non−White Pop

E(crime rate per 100,000) E(crime rate) / average −200 200 400 .75x 1x 1.25x 1.5x

Male Pop

E(crime rate per 100,000) E(crime rate) / average Linear Robust & Resistant Poisson Negative Binomial −200 200 400 .75x 1x 1.25x 1.5x

Education

E(crime rate per 100,000) E(crime rate) / average −200 200 400 .75x 1x 1.25x 1.5x

Inequality

E(crime rate per 100,000) E(crime rate) / average

slide-61
SLIDE 61

Installing tile and simcf

◮ Go to Chris’s website, Software section

slide-62
SLIDE 62

Installing tile and simcf

◮ Go to Chris’s website, Software section ◮ Also download all R scripts and data under today’s Lab section