seinfeld {npsm} | R Documentation |
Seinfeld — the sitcom — viewership counts by episode
Description
Counts of viewers for 9 seasons of Seinfeld
Usage
data("seinfeld")
Format
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
Source
Wikipedia https://en.wikipedia.org/wiki/List_of_Seinfeld_episodes (date unknown).
Examples
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)
[Package npsm version 2.0.0 Index]