Learn R Programming

effects (version 2.2-4)

Titanic: Survival of Passengers on the Titanic

Description

Information on the survival status, sex, age, and passenger class of 1309 passengers in the Titanic disaster of 1912.

Usage

Titanic

Arguments

source

Data set titanic3 from http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/DataSets.

Details

This is part of a larger data set compiled by Thomas Cason. Many additional details are given in the sources cited below.

References

http://www.encyclopedia-titanica.org/ F. E. Harrell, Jr. (2001) Regression Modeling Strategies New York: Springer.

Examples

Run this code
summary(Titanic)
  
titanic <- glm(survived ~ (passengerClass + sex + age)^2, data=Titanic, family=binomial)
  
titanic.all <- allEffects(titanic, typical=median, 
	given.values=c(passengerClass2nd=1/3, passengerClass3rd=1/3, sexmale=0.5))
  	
plot(titanic.all, ticks=list(at=c(.01, .05, seq(.1, .9, by=.2), .95, .99)), ask=FALSE)

plot(effect("passengerClass*sex*age", titanic, xlevels=list(age=0:65)), 
	ticks=list(at=c(.001, .005, .01, .05, seq(.1, .9, by=.2), .95, .99, .995)))

Run the code above in your browser using DataLab