In class Quiz: Tables and Probability
1)
| Below Limit | Detect | Sum | |
|---|---|---|---|
| Private | 81 | 22 | 103 |
| Public | 72 | 48 | 120 |
| Sum | 153 | 70 | 223 |
#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.3229Basically Probility of public&BelowLim / totalPoss
3)
round(70/223, 4)
[1] 0.3139Many of the wells do not have a Detect value (null)
4)
round((72 + 48 + 22)/223,4)
[1] 0.6368