Learn R Programming

BSDA (version 0.1)

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

Description

Data for Exercise 5.82

Usage

Housing

Arguments

source

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Duxbury

Examples

Run this code
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 
 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