Statistical Analysis - Homework 3 Solutions | STAT 200, Assignments of Statistics

Material Type: Assignment; Class: Statistical Analysis; Subject: Statistics; University: University of Illinois - Urbana-Champaign; Term: Spring 2002;

Typology: Assignments

Pre 2010

Uploaded on 03/10/2009

koofers-user-2ks
koofers-user-2ks 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Stat 200
Homework 3 Solutions
On Your Own #2
a) Our best guess for the weight is the class mean and you are likely to be off by the
standard deviation.
b) β
1
= r*(S
y
/S
x
) = .5*(23.27/3.97) = 2.93073
β
0
=
Y
β
1
X=158.712.93*69.47 = -44.8371
weight = -44.8371 + 2.93*height
c)
-44.8371 + 2.93*70 = 160.263 pounds
S
e
=1
r
2
*
S
y
=1.5
2
* 23.27 =20.1524
d)
predicted weight: -44.8371 + 2.93*74 =
171.9829
= W
residuals:
161 – W = -10.98 180 – W = 8.02 190 – W = 18.02
3.2
…Enter in the data and then recreate the table. Make a segmented barplot showing
the amount of spam and the total amount of e-mail.
Solution
> spam <- matrix(c(50,125,110,210,225,375,315,475,390,590,450,700), nrow=2)
> rownames(spam) <- c("spam", "total")
> colnames(spam) <- c("2000", "2001", "2002", "2003", "2004", "2005")
> spam
2000 2001 2002 2003 2004 2005
spam 50 110 225 315 390 450
total 125 210 375 475 590 700
> barplot(spam, main="Volume of spam in commercial e-mail (in billions)")
2000 2001 2002 2003 2004 2005
Volume of spam in commercial e-mail (in billions)
0 200 400 600 800
pf3
pf4

Partial preview of the text

Download Statistical Analysis - Homework 3 Solutions | STAT 200 and more Assignments Statistics in PDF only on Docsity!

Stat 200

Homework 3 Solutions

On Your Own #

a) Our best guess for the weight is the class mean and you are likely to be off by the standard deviation.

b) β 1 = r(Sy/Sx) = .5(23.27/3.97) = 2.

β 0 = Y − β 1 X = 158.71− 2.93* 69.47 = -44.

weight = -44.8371 + 2.93*height

c) -44.8371 + 2.93*70 = 160.263 pounds

Se = 1 − r^2 * Sy = 1 − .5^2 * 23.27 = 20.

d) predicted weight: -44.8371 + 2.93*74 = 171.9829 = W residuals: 161 – W = -10.98 180 – W = 8.02 190 – W = 18.

3.2 …Enter in the data and then recreate the table. Make a segmented barplot showing the amount of spam and the total amount of e-mail.

Solution

spam <- matrix(c(50,125,110,210,225,375,315,475,390,590,450,700), nrow=2) rownames(spam) <- c("spam", "total") colnames(spam) <- c("2000", "2001", "2002", "2003", "2004", "2005") spam 2000 2001 2002 2003 2004 2005 spam 50 110 225 315 390 450 total 125 210 375 475 590 700

barplot(spam, main="Volume of spam in commercial e-mail (in billions)")

2000 2001 2002 2003 2004 2005

Volume of spam in commercial e-mail (in billions)

0

200

400

600

800

3.8 …Create side-by-side boxplots of the variable reaction.time (Using R) for the two values of control. Compare the centers and spreads.

Solution ~ load R package UsingR.

attach(reaction.time) C <- time[which(control=="C")] T <- time[which(control=="T")] boxplot(C,T, names=c("No cell phone", "Cell phone"))

No cell phone Cell phone

In comparing the two boxplots answers may vary. As long as something was mentioned about the center and spread are shifted by what appears to be a good amount. No cell phone usage has a faster time response than cell phone usage.

3.10 The data set stud.recs (UsingR) contains 160 SAT scores for incoming college students stored in the variables sat.v and sat.m. Produce side-by-side densityplots of the data. Do the two data sets appear to have the same center? Then make a quantile- quantile plot. Do the data sets appear to have the same shape?

Solution ~load R package UsingR

attach(stud.recs) plot(density(sat.v), ylim=c(0,0.006), main="densityplots of Verbal and Math SAT scores") lines(density(sat.m), lty=2)

batted in. What is his predicted number of RBIs based on his number of home runs? What is his residual?

Solution ~load R package Using R

model <- lm(RBI~HR, data=batting) plot(batting$HR, batting$RBI) abline(model)

batting$HR

batting$RBI

predict(model, data.frame(HR=33)) [1] 104.

104.1099 - 98 [1] 6.