Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic •...

28
Would you have survived the sinking of the Titanic? Presented by Dr. Neil W. Polhemus Using the Statgraphics mosaic charts, multiple correspondence analysis and logistic regression procedures.

Transcript of Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic •...

Page 1: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Would you have

survived the

sinking of the

Titanic?

Presented by Dr. Neil W. Polhemus

Using the Statgraphics mosaic charts, multiple correspondence analysis and logistic regression procedures.

Page 2: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

RMS Titanic

Page 3: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Sinking of the Titanic

• Struck an iceberg on April 14, 1912 and sank the

next morning.

• Carried over 2000 passengers and crew, many

of whom did not survive.

• Controversies have centered on the lack of

sufficient lifeboats and the differential treatment

of individuals based on class of accommodation.

Page 4: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Sample Data File #1

Source: Robert J. MacG. Dawson, Saint Mary’s University http://www.amstat.org/publications/jse/datasets/titanic.txt

VARIABLE DESCRIPTIONS: Class (1 = first, 2 = second, 3 = third, 0 = crew) Age (1 = adult, 0 = child) Sex (1 = male, 0 = female) Survived (1 = yes, 0 = no)

n=2,201 observations (all people at risk)

Page 5: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Sample Data File #2

Source: Frank Harrell and Thomas Cason, University of Virginia http://biostat.mc.vanderbilt.edu/twiki/pub/Main/DataSets/titanic.html

n=1,309 observations (passengers only) Note that age is numeric.

Page 6: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Crosstabulation

Page 7: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Mosaic Charts

Page 8: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Mosaic Charts

Page 9: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Mosaic Charts

Page 10: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Mosaic Charts

Page 11: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Multiple Correspondence Analysis

• Creates a map of the associations amongst the

categories of 2 or more variables.

• Seeks a small number of dimensions that

describe most of the variability or “inertia”

amongst the categories.

• Very useful in demonstrating the

interrelationships amongst the variables.

Page 12: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Data Input

Page 13: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Burt Table

Page 14: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Multiple Mosaic Plot

Page 15: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Inertia and Chi-Square Decomposition

Page 16: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Scree Plot

Page 17: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Correspondence Map

Page 18: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Logistic Regression

• Binary logistic regression is designed to model situations in which there are only 2 possible outcomes, such as “survived” or “did not survive”.

• It estimates a model that predicts the probability of those outcomes as a function of 1 or more predictor variables.

• The predictor variables may be either quantitative or categorical.

Page 19: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Bernoulli Events

• A Bernoulli event is an event in which 2

outcomes are possible.

• Let Yi = 1 if ith person survived, 0 otherwise.

• The pmf for a Bernoulli event is

𝑃𝑟𝑜𝑏 𝑦 = 𝑝𝑦(1 − 𝑝)1−𝑦 where 0 ≤ p ≤ 1

Page 20: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Predictor Variables

• We now want to let p be a function of one or

more predictor variables X. In particular:

– X1 = class

– X2 = age

– X3 = sex

Then: 𝑝 = 𝑓(𝑋1, 𝑋2, 𝑋3)

Page 21: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Logistic Model

• When modeling p, we need a model that remains between 0 and 1.

• Most common choice is the logistic model:

log𝑝

1 − 𝑝= 𝛽0 + 𝛽1𝑋1 + 𝛽2𝑋2 + ⋯

• It is a model for the log odds. If less than 0, odds are against the event. If greater than 0, odds are in favor of the event.

Page 22: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Data Input

Page 23: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Analysis Options

Page 24: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Likelihood Ratio Test

• Full second order model

• Simplified model

Page 25: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Plot of Fitted Model

Page 26: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Predictions

Page 27: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Recommended Reading

• Correspondence Analysis in Practice (second

edition) by Michael Greenacre (Chapman and

Hall, 2007)

• Applied Logistic Regression (third edition) by

David Hosmer and Stanley Lemeshow (Wiley,

2013)

Page 28: Would you have survived the sinking of the Titanic? Webinar.pdf · Sinking of the Titanic • Struck an iceberg on April 14, 1912 and sank the next morning. • Carried over 2000

Recorded Webinar

• You may find the recorded webinar, PowerPoint

slides and sample data at:

www.statgraphics.com

• Look for “Instructional Videos”.