Learn R Programming

BSDA (version 1.01)

Housing: Median home prices for 1984 and 1993 in 37 markets across the U.S.

Description

Data for Exercise 5.82

Usage

Housing

Arguments

Format

A data frame with 37 observations on the following 3 variables.

City

a factor with levels Albany Anaheim Atlanta Baltimore Birmingham Boston Chicago Cincinnati Cleveland Columbus Dallas Denver Detroit Ft Lauderdale Houston Indianapolis Kansas City Los Angeles Louisville Memphis Miami Milwaukee Minneapolis Nashville New York Oklahoma City Philadelphia Providence Rochester Salt Lake City San Antonio San Diego San Francisco San Jose St Louis Tampa Washington

X1984

a numeric vector

X1993

a numeric vector

Examples

Run this code
# NOT RUN {
str(Housing)
attach(Housing)
stem(X1993)
stem(X1984)
par(mfrow=c(2,2))
stripchart(x=list(X1984,X1993),method="stack",pch=1,cex=1.2,col=c("orange","pink"),group.names=c("1984","1993"))
title(main="Problem 5.82 \n We have not talked about this kind of graph before...")
hist(X1993,breaks="Scott",col="pink")
hist(X1984,breaks="Scott",col="orange")
plot(density(X1993),col="red",xlab="",ylab="",main="",ylim=c(0,.00003))
lines(density(X1984),col="orange")
par(mfrow=c(1,1))
boxplot(X1993,X1984,col=c("pink","orange"),names=c("1993","1984"),main="Problem 5.82")
SIGN.test(X1984,conf.level=.98)
SIGN.test(X1993,conf.level=.98)
# 98% CI -> 63591.1 79622.56 and 85591.69 109915.4
# Placing on a common number line...
my.axis <- function(side, at, labels,...)
{for(i in seq(along=at)) axis(side=side, at=at[i], labels=labels[i],...) }

plot(1,type="n",xlim=c(63000,110000),ylim=c(0,1),
xlab="Median House Price",ylab="",yaxt="n",main="")
title(main="98 Percent Confidence Intervals")
my.axis(2,at=c(.25,.75),labels=c("1984","1993"), cex.axis=1.2 ,las=2)
lines( c(63591.1, 79622.56),c(.25,.25),col="orange",lwd=24)
lines( c(85591.69, 109915.4),c(.75,.75),col="pink",lwd=24)
detach(Housing)
# }

Run the code above in your browser using DataLab