SDS 291: Multiple Regression

TYPE YOUR NAME – Fall 2018 – Prof. Reagan


HW 1: Due Thursday, September 13, 2012

  • Reading: Chapter 0 and sections 1.1, 1.2, and 1.3
  • Exercises to hand in: #0.9, #0.15, #0.16.

require(mosaic)

Exercise 0.9

Write your answers below

Exercise 0.15

Here is the initial R code to get you started on 0.15

# make sure you get this URL right!
Survey = read.csv("https://andyreagan.github.io/teaching/2018/09-SDS-291/data/Day1Survey.csv")
summary(Survey)
##     Section            Class    Sex       Distance         Height     
##  Min.   :1.000   *        : 1   F:17   Min.   :   50   Min.   :60.00  
##  1st Qu.:1.000   Freshman :12   M:26   1st Qu.:  300   1st Qu.:66.00  
##  Median :1.000   Junior   :11          Median :  600   Median :70.00  
##  Mean   :1.442   N/A      : 1          Mean   : 1579   Mean   :68.84  
##  3rd Qu.:2.000   Senior   :10          3rd Qu.: 1000   3rd Qu.:72.50  
##  Max.   :2.000   Sophomore: 8          Max.   :20000   Max.   :77.00  
##                                        NA's   :1                      
##         Handedness     Coins         WhiteString     BlackString    
##  Ambidextrous: 1   Min.   :  0.00   Min.   :22.00   Min.   : 0.000  
##  Left        : 4   1st Qu.:  0.00   1st Qu.:32.00   1st Qu.: 2.000  
##  Right       :38   Median :  1.00   Median :38.00   Median : 4.000  
##                    Mean   : 18.76   Mean   :38.33   Mean   : 5.395  
##                    3rd Qu.:  4.00   3rd Qu.:43.00   3rd Qu.: 6.000  
##                    Max.   :500.00   Max.   :70.00   Max.   :42.000  
##                                                                     
##     Reading             TV             Pulse          Texting     
##  Min.   :   2.0   Min.   : 0.000   Min.   :48.00   Min.   :  0.0  
##  1st Qu.:  50.0   1st Qu.: 2.000   1st Qu.:57.00   1st Qu.:  3.5  
##  Median : 100.0   Median : 3.000   Median :66.00   Median : 10.0  
##  Mean   : 172.4   Mean   : 4.814   Mean   :67.12   Mean   : 30.7  
##  3rd Qu.: 200.0   3rd Qu.: 5.500   3rd Qu.:75.00   3rd Qu.: 35.0  
##  Max.   :2000.0   Max.   :25.000   Max.   :96.00   Max.   :250.0  
## 

part a: does resting pulse differ by gender?

summary(Survey$Pulse)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   48.00   57.00   66.00   67.12   75.00   96.00
Males = subset(Survey, Sex == "M")
Females = subset(Survey, Sex == "F")
summary(Males$Pulse)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   48.00   57.00   66.00   66.65   72.00   96.00
summary(Females$Pulse)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   51.00   60.00   72.00   67.82   75.00   90.00
densityplot(~ Pulse, data=Survey, groups=Sex)

dotplot(~ Pulse | Sex, data=Survey)

part b:

Exercise 0.16

Do women expect to do more reading than men?

You might want to read about Welch’s t-test, or more generally about independent two-sample t-tests.