Problem I

(a)

The category with the most people is Married.

(b)

It appears that while the percentage of each marital status within a weight class when compared to each other is similar, when compared against each other far fewer overweight people were surveryed in general.

(c)

It appears that more men are obese, because while a very similar amount of both men and women were sampled, there’s approximately double the amount of obese men as there are obese women.

(d)

Because the number of male and female subjects sampled was very close to the same (as found above) men accounting for two thirds of the widowed data indicates that men are more often widowed than women.

Problem II

(a)

There is a slightly larger proportion of men, which can be seen by looking at the top mosaic plot, where the ‘male’ blocks are slightly broader.

(b)

There is a larger proportion of underweight subjects in the dataset. This can be identified in the lower mosaic plot, where the ‘underweight’ blocks dwarf the ‘overweight’ blocks.

(c)

There is a larger proportion of underweight females in the dataset. This can be identified in the upper mosaic plot, by comparing the two far left blocks.

(d)

There are relatively more overweight males in the dataset. This can be identified in the lower mosaic the best, by comparing the two far left blocks.

Problem III

(a)

The subgroup with the most people in it is ‘Married’. This can be identified in the upper mosaic the best, by comparing vertical groupings and seeing which one is the largest.

(b)

Based on the data there are more underweight widows than overweight widows. This can be identified in the upper mosaic the best, by comparing rightmost blocks on the top row and the bottom row.

(c)

There are slightly more divorced people than widowed people. This can be identified in the lower mosaic the best, by comparing the two blocks on top and the two on the bottom. While the underweight number of each of these categories is too similar for me to make a judgement, there is a (slightly) larger number of overweight divorcees.

(d)

It seems that marriage is the subgroup in which the smallest proportion of the sample is overweight. I am basing this off of the upper mosaic plot, where the overweight block is the thinnest.

Code

Problem I

work <- read.csv("C:/Users/Lisa/Downloads/work.csv")

(a)

my.table = table(work$marriage)
barplot(my.table, main= "Marital Status")

The category with the most people is Married.

(b)

bigger.table = table(work$obese, work$marriage)
barplot(bigger.table, legend = rownames(bigger.table),col = c("pink","green"),xlab="Marital Status",main = "Marital Status By Weight",beside = TRUE)

It appears that while the percentage of each marital status within a weight class when compared to each other is similar, when compared against each other far fewer overweight people were surveryed in general.

(c)

bigger.table = table(work$obese, work$gender)
barplot(bigger.table, legend = rownames(bigger.table),col = c("pink","green"),xlab="Gender",main = "Weight By Gender",beside = TRUE)

It appears that more men are obese, because while a very similar amount of both men and women were sampled, there’s approximately double the amount of obese men as there are obese women.

(d)

bigger.table = table(work$gender, work$marriage)
barplot(bigger.table, legend = rownames(bigger.table),col = c("blue","magenta"),xlab="Marital Status",main = "Marital Status By Gender",beside = TRUE)

Because the number of male and female subjects sampled was very close to the same (as found above) men accounting for two thirds of the widowed data indicates that men are more often widowed than women.

Problem II

mosaicplot(gender ~ obese, data = work, main = "Weight By Gender")

mosaicplot(obese ~ gender, data = work, main = "Gender By Weight")

Answers (a)-(d)

Problem III

mosaicplot(marriage ~ obese, data = work, main = "Weight By Marital Status")

mosaicplot(obese ~ marriage, data = work, main = "Marital Status By Weight")

Answers (a)-(d)