In class Quiz: Tables and Probability

1)

Below LimitDetectSum
Private8122103
Public7248120
Sum15370223
#prob of prviate given direct?
tabb <- table(MTBE$WellClass,MTBE$MTBE.Detect) #create table w/ both vars
addmargins(tabb)#automatically creates the sum column
round(22/70,4)#we wan round 4 decimal place 

2)

round(72/223,4)
[1] 0.3229

Basically Probility of public&BelowLim / totalPoss

3)

round(70/223, 4)
[1] 0.3139

Many of the wells do not have a Detect value (null)

4)

round((72 + 48 + 22)/223,4)
[1] 0.6368