seinfeld | R Documentation |
Counts of viewers for 9 seasons of Seinfeld
data("seinfeld")
A data frame with 180 observations on the following 4 variables.
episodeNumberOverall
a numeric vector
season
a numeric vector
episodeNumberSeason
a numeric vector
viewers
a numeric vector
Wikipedia https://en.wikipedia.org/wiki/List_of_Seinfeld_episodes (date unknown).
data(seinfeld)
#Comparison boxplots of views versus season
boxplot(viewers~season,data=seinfeld,ylab='Number of Viewers (in millions)',xlab='Season')
# Normal q-q plots for selected seasons.
oldpar_mfrow <- par()$mfrow
par(mfrow=c(2,2))
seasons2display <- c(4,5,6,9)
for( s in seasons2display) {
v <- seinfeld[seinfeld$season==s,'viewers']
qqnorm(v,main=paste("Season",s))
abline(a=median(v),b=mad(v))
}
par(mfrow=oldpar_mfrow)
# Normal q-q plots for selected seasons
# using centered and scaled residuals.
oldpar_mfrow <- par()$mfrow
par(mfrow=c(2,2))
seasons2display <- c(4,5,6,9)
for( s in seasons2display) {
v0 <- seinfeld[seinfeld$season==s,'viewers']
v1 <- (v0 - median(v0))/mad(v0)
qqnorm(v1,main=paste("Season",s))
abline(a=0,b=1)
}
par(mfrow=oldpar_mfrow)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.