Learn R Programming

BSDA (version 1.01)

Simpson: Grade point averages of men and women participating in various sports-an illustration of Simpson's paradox

Description

Data for Example 1.18

Usage

Simpson

Arguments

Format

A data frame with 100 observations on the following 15 variables.

gpa

a numeric vector

spor

a numeric vector

gender

a numeric vector

gpamale

a numeric vector

sptmale

a numeric vector

gpafemal

a numeric vector

sptfemal

a numeric vector

bbgpa

a numeric vector

genderbb

a numeric vector

sogpa

a numeric vector

genderso

a numeric vector

tkgpa

a numeric vector

gendertk

a numeric vector

gradept

a numeric vector

gender2

a numeric vector

Examples

Run this code
# NOT RUN {
str(Simpson)
attach(Simpson)
par(mfrow=c(1,2))
boxplot(gpa~gender,col=c("blue","pink"),names=c("Male","Female"),
main="GPA versus Gender",xlab="Gender",ylab="Grade Point Average")
boxplot(gradept~gender2,las=2,col=c("blue","pink"),
names=c("M-BBALL","F-BBALL","M-SOCC","F-SOCC","M-TRAC","F-TRAC"),
ylab="Grade Point Average",main="GPA vs Gender by Sports")
par(mfrow=c(1,1))
detach(Simpson)
# }

Run the code above in your browser using DataLab