Lab 1G
Directions: Follow along with the slides and answer the questions in red font in your journal.
data()
function to load the atu_clean
data file to use in this lab.gender
seem to have a higher occurrence of physical challenges than the other? If so, which one and explain your reasoning?format = "percent"
as an option to the code you used to make your 2-way frequency table. Then answer this question again:
gender
seem to have a higher occurrence of physical challenges than the other? If so, which one and explain your reasoning?margins = TRUE
as an option in the tally function.phys_challenge | gender
and gender | phys_challenge
.## gender
## phys_challenge Male Female
## No difficulty 4140 5048
## Has difficulty 530 775
## Total 4670 5823
## phys_challenge
## gender No difficulty Has difficulty
## Male 4140 530
## Female 5048 775
## Total 9188 1305
At first glance, the two-way frequency tables might look similar (especially when the margin
option is excluded). Notice, however, that the totals are different.
The totals are telling us that R
calculates conditional frequencies by column!
What does this mean?
Male
and Female
on the distribution of physical challenges.No difficulty
and those that Has difficulty
on the distribution of gender.Add the option format = "percent"
to the first tally function. How were the percents calculated? Interpret what they mean.