# cleanup the env to start fresh
rm(list=ls())library(VennDiagram)## Loading required package: grid
## Loading required package: futile.logger
grid.newpage()
draw.pairwise.venn(area1 = 14.6, area2 = 20.7, cross.area = 4.2,
category = c("Below_Poverty", "Foreign_Language"),
ty = rep("blank", 2),
fill = c("light blue", "pink"),
alpha = rep(0.5, 2) ) ## (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], polygon[GRID.polygon.4], text[GRID.text.5], text[GRID.text.6], text[GRID.text.7], text[GRID.text.8], text[GRID.text.9])
This can also be 27/94 incase the fiction book was hardcover But since we are doing probability, this should be very close to 28/94 ##### Combined .75789 * .29787 = .22575
setwd("C:\\CUNY\\606Statistics\\Assignments")Baggage Fee Probability Table
$15.70(avg. revenue per passenger) * 120 = ##### $1884
Income <- c("$1 to $9,999 or loss",
"$10,000 to $14,999",
"$15,000 to $24,999",
"$25,000 to $34,999",
"$35,000 to $49,999",
"$50,000 to $64,999",
"$65,000 to $74,999",
"$75,000 to $99,999",
"$100,000 or more"
)
Total <- c(2.2,
4.7,
15.8,
18.3,
21.2,
13.9,
5.8,
8.4,
9.7
)
personalIncomeDF <- data.frame(income=Income, total=Total)
#grid.newpage()
barplot(personalIncomeDF$total, names.arg=personalIncomeDF$income, col="green")sum(personalIncomeDF$total[1:5])## [1] 62.2
We also assume that women and mean are equally spread in the income sections This would mean the income and gender is independent ##### P(less_than_50k) * P(female) = 25.50%
Since 71.8% of females make less than $50k a year
There would be lesser women in the higher income segments This would mean that there is dependence between income and gender
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.