library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
grid.newpage()
vplot <- draw.pairwise.venn(area1 = 14.6 ,
area2 = 20.7,
cross.area = 4.2,
category = c("Below Poverty", "Foreign Language"),
fill = c("pink","yellow"),
cat.cex = 2,
#cex = 2,
cat.pos = c(0,0)
)
c.below poverty - what fall into both category 14.6 - 4.2 = 10.4 ~ 0.104 d.below porverty and speak foreign language 35.3 ~ 0.353 e. is 68% f.no
cat("a.",28/95 * 59/94 ,"%")
## a. 0.1849944 %
cat("b. hardcocer + papercover ", (13/95 * 27/94) + (59/95 * 28/94), "%")
## b. hardcocer + papercover 0.2243001 %
cat("c." , (72/95)*(28/94))
## c. 0.2257559
#d. because it’s just slightly different
bag <- c(0,1,2)
price <- c(0,25,35)
percent <- c(0.54,0.34,0.12)
ok <- (price * percent)
cat("AVG:" ,sum(price * percent))
## AVG: 12.7
string.income <- c("1 - 9,999","10,000 - 14,999","15,000 - 24,999","25,000 - 34,999","35,000 - 49,999","50,000 - 64,999","65,000 - 74,999","75,000 - 99,999","100,000 ->")
total.percent <- c(2.2, 4.7, 15.8, 18.3, 21.2, 13.9, 5.8, 8.4, 9.7)
df <- data.frame(string.income,total.percent)
barplot(df$total.percent ,ylab = "Percent",main = "Income-Total", names.arg = string.income)
#b
sum(total.percent[1:5])
## [1] 62.2
#c
cat("female and less 50k is:", (sum(total.percent[1:5]) / 100) *0.41)
## female and less 50k is: 0.25502
#d
# my assumption was not valid