Due date: 2016-10-07.

  1. OS3 Exercises within Section 2.6:

2.33)

We can estimate this probability using the data. Of the 280 cases in this data set where parents takes value degree, 231 represent cases where the teen variable takes value college: P(teen college given parents degree) =

231/280
## [1] 0.825

2.36A) From the given information there are 36 number cards in a deck of 52 cards sible number of ways to get 2-10 number cards from a deck is 36/52= 0.6923

There are 12 face cards in a 52 deck the possible number of ways to get a face card is 12/52= 0.2308

There are 4 ace in the deck 4/52= 0.0769

Expected profit= (0x0.6923)+($3x0.2308)+($5x0.0769)+(25x0.0192)= $0+$0.69+$0.38+0.48 =$1.26 The expected profit is $1.56

B.) From this you can say that this game is not a good way for Andy to make money because the expected profit is very small.

  1. OS3 Exercises within Section 3.6:

3.4)

A.) X~N(4313, 583) Y denotes the finishing time for women Y~N(5261, 807)

  1. Leo’s Z score
(4989-4313)/583
## [1] 1.15952

Mary’s Z score

(5513-5261)/807
## [1] 0.3122677

C.) By comparing both of Leo’s and Mary’s Zscore values you can see that Leo’s score is higher than Mary’s score. Based on this evidence one can say that Leo’s rank is better in their respective groups.

  1. P(Z<1.1595)
pnorm(1.1595)
## [1] 0.8768738
  1. P(Z<0.3123)= 0.622= 62.25%
pnorm(.3123)
## [1] 0.6225937
  1. The z-score values will not change as z scores can be calculated for distributions that are not nrmal. However, we could not anwser all the parts given, since we cannot use the normal probabiltiy table to calculate probabilities and percentiles.

3.7) a) Z=1.2 = 0.1151

B.)

qnorm(.1)*5+77
## [1] 70.59224

3.10)a)

z= (48-55)/6

pnorm(-1.17)
## [1] 0.1210005
  1. P(60<X<65)=0.1558= 15.58%
(60-55)/6
## [1] 0.8333333
(65-55)/6
## [1] 1.666667
pnorm(1.67)
## [1] 0.9525403
pnorm(0.83)
## [1] 0.7967306
(0.9525-0.7967)
## [1] 0.1558
qnorm(0.9)
## [1] 1.281552
(55+6)*1.282
## [1] 78.202

Tallest 10% cutoff = 62.69

  1. P(X>54)
(54-55)/6
## [1] -0.1666667
pnorm(-0.17)
## [1] 0.4325051
1-0.4325
## [1] 0.5675

=0.5675 56.75% of 10 yaer olds are lucky enough to be eligible for batman the ride.

3.29) P(X>1786)

1-pbinom(1786, 2500, .7)
## [1] 0.05506358

0.0551

3.30) P(X>1500)

(1500-1350)/35.05
## [1] 4.279601
pnorm(4.18)
## [1] 0.9999854
1-0.99999
## [1] 1e-05
  1. re Random Variables, slide \(68, 95, 99.7\) Rule, HW04
pnorm(.68, 75,25)
## [1] 0.001475483
1-pnorm(.68, 75, 25)
## [1] 0.9985245
  1. Read OS3 Section 4.2.

  2. Explore the dataset named carnivora in the library ape.

    1. Make four different plots and describe each plot with at least one complete, English sentence.

    2. Calculate the mean and standard error of 2 numeric variables.

    3. Calculate and interpret the confidence interval of two more numeric variables grouped by a categorical variable.

    4. Comment on the accuracy of your confidence intervals while referencing OS3 Section 4.2.4’s box labeled “Conditions for the sample mean being nearly normal and SE being accurate,”

library(ape)
data(carnivora)

plot(carnivora$Family)

plot(carnivora$Family, carnivora$SW, xlab = "Families", ylab = "SW", main = "Boxplot of Carnivora Families vs. SW")

plot(carnivora$SW, carnivora$FW, xlab="SW", ylab="FW", main = "FW vs SW" , xlim =c(0,100), ylim =c(0,150))

B) Mean and standard deviation

summary(carnivora)
##        Order         SuperFamily         Family        Genus   
##  Carnivora:112   Caniformia:57   Viverridae :32   Mustela : 9  
##                  Feliformia:55   Mustelidae :30   Herpetes: 8  
##                                  Felidae    :19   Panthera: 5  
##                                  Canidae    :18   Canis   : 4  
##                                  Hyaenidae  : 4   Martes  : 4  
##                                  Procyonidae: 4   Felis   : 3  
##                                  (Other)    : 5   (Other) :79  
##                     Species          FW                SW         
##  Acinonyx jubatus       :  1   Min.   :  0.050   Min.   :  0.050  
##  Ailuropoda melanoleuca :  1   1st Qu.:  1.245   1st Qu.:  1.400  
##  Alopex lagopus         :  1   Median :  3.400   Median :  3.895  
##  Aonyx capensis         :  1   Mean   : 18.099   Mean   : 20.084  
##  Arctictis binturong    :  1   3rd Qu.: 10.363   3rd Qu.: 11.592  
##  Arctogalidia trivirgata:  1   Max.   :320.000   Max.   :365.000  
##  (Other)                :106                                      
##        FB               SB               LS              GL        
##  Min.   :  1.00   Min.   :  1.00   Min.   :1.000   Min.   : 23.50  
##  1st Qu.: 15.25   1st Qu.: 15.68   1st Qu.:2.500   1st Qu.: 53.80  
##  Median : 33.00   Median : 33.75   Median :3.000   Median : 63.00  
##  Mean   : 53.40   Mean   : 56.43   Mean   :3.232   Mean   : 65.79  
##  3rd Qu.: 57.38   3rd Qu.: 57.17   3rd Qu.:3.800   3rd Qu.: 73.50  
##  Max.   :365.00   Max.   :459.50   Max.   :8.800   Max.   :168.00  
##                                    NA's   :2       NA's   :21      
##        BW                WA              AI               LY     
##  Min.   :   0.01   Min.   : 21.0   Min.   :  56.0   Min.   : 96  
##  1st Qu.:  41.88   1st Qu.: 54.5   1st Qu.: 183.8   1st Qu.:141  
##  Median : 116.25   Median : 70.0   Median : 365.0   Median :162  
##  Mean   : 249.31   Mean   :104.0   Mean   : 407.8   Mean   :182  
##  3rd Qu.: 286.88   3rd Qu.:117.0   3rd Qu.: 592.5   3rd Qu.:207  
##  Max.   :1650.00   Max.   :730.0   Max.   :1080.0   Max.   :408  
##  NA's   :50        NA's   :49      NA's   :82       NA's   :63   
##        AM           IB    
##         :57          :55  
##  365    : 8   12     :27  
##  730    : 5   6      :13  
##  913    : 4   24     : 2  
##  450    : 2   27     : 2  
##  1095   : 1   4      : 2  
##  (Other):35   (Other):11
  1. Finish the code chunk in counted.R to compare proportions of police killings by state and race/ethnicity.