The gap has persisted for decades. In the U.S., it has narrowed since the 1980s, with relatively little change over the past two decades. Pew Research Center
Differences in occupations, experience, family responsibilities, and discrimination can all contribute to the gap.
Q1: Is the gender pay gap closing?
Your prediction
In 1991, women with bachelor’s degrees earned about 62% of what men with bachelor’s degrees earned.
Here we are measuring median annual earnings.
What do you think that percentage was in 2024?
Enter a number between 0 and 100.
The historical earnings table
Workers aged 25+ across occupations, from 1991 through 2024.
Each row contains median annual earnings for one year, sex, and education level.
The two groups are bachelor’s and master’s degree holders.
The first plot we want
Plot earnings over time
Plot median earnings against year, with a different color for each sex.
Connect each group’s earnings over time with a line.
Make separate panels for bachelor’s and master’s degree holders.
Measure the gap relatively
Pay has risen for both groups. A dollar gap of $10,000 means something different when earnings are $30,000 than when they are $100,000.
We will measure women’s median earnings as a fraction of men’s.
Suppose median earnings double for both groups. What happens to the dollar gap? What happens to women’s earnings as a fraction of men’s earnings? Which would you plot across these decades?
The two numbers we need
We need both earnings amounts on the same row to calculate Female / Male.
The table we want
# A tibble: 2 × 4
year education Female Male
<dbl> <chr> <dbl> <dbl>
1 1991 Bachelor's degree 22.5 36.0
2 2024 Bachelor's degree 62.0 85.7
How would you turn the previous table into this one? Describe the steps or name the command you would use.
Reshape the earnings
Open the current fold and fill in the two column names.
Keep bachelor’s and master’s earnings.
Put male and female pay on the same row for each year and education level.
Calculate women’s pay as a fraction of men’s pay.
Calculate the relative earnings
A ratio of 0.80 means women’s median earnings are 80% of men’s.
Keep bachelor’s and master’s earnings.
Put male and female pay on the same row for each year and education level.
Calculate women’s pay as a fraction of men’s pay.
Plot the gap over time
The completed history_gap table is available.
Plot the female/male earnings ratio over time for both education levels. Submit your plot. State whether the gap has closed by 2024.
What happened from 1991 to 2024?
Interpret the change
How did the gap change for each education level? Did more education correspond to a smaller gap in 2024? Use the ratios in your answer.
When would earnings reach parity?
ratio = 1 means equal median earnings.
Could we use a straight line to estimate when that happens?
Choose an education group. What would you regress on what? How would you use the fitted line to estimate the year of equal earnings?
Set the earnings ratio to 1 and solve for the year. How far beyond our last observation is that?
Ask R for the same answer
The fitted trend reaches 1 around 2144.
Does the chosen period matter?
This fit uses 2000–2024. Use its coefficients to get another parity year. Would you report either year as a precise prediction? Explain.
Q1: What did we find?
The bachelor’s earnings gap narrowed from 1991 to 2024.
In 2024, women’s median earnings were about 72% of men’s for bachelor’s graduates and 69% for master’s graduates.
Our fitted bachelor’s trend reaches equal median earnings around 2144.
What else would you want to know about the workers in these groups?
Q2: Where is the gender pay gap largest?
ACS data
Each row describes one worker surveyed in 2024.
These are full-time computer/math workers, ages 25–50, with a BA or MA.
pay is annual wage income in thousands of 2024 dollars.
Start with the overall gap
What are the median earnings for men and women in this sample?
Group the workers by sex and report n and median_pay for each group.
Report the difference in median earnings in dollars.
The overall result
The median earnings gap in this sample is about $20,000/year.
Does the gap remain within the same job and degree?
Let’s investigate software developers with bachelor’s degrees.
occupation_code connects the worker records to these occupation names.
Could the gap differ by age?
After keeping one job and degree, do you expect a similar pay gap among workers in their twenties and workers in their forties? Explain. What would you plot to check it?
The age plot we want
We want median earnings at each age among software developers with bachelor’s degrees.
How does the gap change with age?
Join occupation_names to acs and keep software developers with bachelor’s degrees.
Calculate the number of workers and median pay for each sex and age. Call the columns n and median_pay.
Plot median pay by age, distinguishing men and women. Label the axes and include the pay units.
Add a code comment describing how the gap differs between workers in their twenties and forties.
What do the age medians show?
Same job, same degree
At ages 25–29, both groups have median earnings of about $112k.
At ages 40–49, the medians are $122k for women and $159k for men.
What could explain this pattern?
Among software developers with bachelor’s degrees, median earnings are similar for younger men and women, but farther apart for older workers.
What could be driving this pattern? Suggest an explanation and describe what additional data you would use to investigate it.
What if everyone works 40 hours?
Use software_bachelors, our completed one-job, one-degree table. Investigate ages 25–29 and 40–49, keeping only 40-hour workers.
Keep 40-hour workers aged 25-29 or 40-49. Label the two groups age_group using ifelse().
Report n and median_pay for each sex and age_group.
Put Male and Female medians on the same row for each age_group and calculate gap in dollars as Male minus Female.
What changed when we held hours fixed?
How would you describe these results to a student about to graduate? Use the earnings gaps in both age groups.
Model mean pay by age
Our plots have summarized median pay. The linear regression we learned on Tuesday models mean pay.
We can fit one mean-pay line for men and one for women among these software developers with bachelor’s degrees.
Use software_bachelors again, which includes all work schedules.
The interaction coefficient will tell us how their slopes differ.
How would you write one regression formula that fits both lines? What would its response, age variable, and indicator be?
add_predictions() adds a fit column, as in Tuesday’s forecast plot.
Mean earnings and fitted lines
Test whether the slopes differ
Which row tests equal slopes? What does its estimate tell us about the age pattern? What does its p-value tell us?
Is the gap larger among the highest earners?
Return to all 27,028 workers in acs. Their median earnings gap is about $20,000.
Do you expect a similar dollar gap among low earners and high earners? What would you look at beyond the median to check your prediction?
Look beyond the middle
The 10th percentile describes earnings near the lower end.
The 50th percentile is the median.
The 90th percentile describes earnings near the upper end.
quantile() finds these values. probs = 0.9 asks for the 90th percentile.
The earnings plot we want
Each percentile needs an earnings value for men and one for women.
Where is the dollar gap largest?
Calculate p10, p50, and p90 of pay separately for men and women.
Reshape the three percentile columns into rows named percentile and pay.
Plot earnings by percentile, distinguishing men and women. Label the pay units.
Add a code comment stating where the dollar gap is largest, using values from your table.
The gap across the earnings distribution
A report describes the earnings gap as $20,000. Write a more informative one-sentence summary using this plot.
Additional investigations
The next examples are available if time remains.
What might explain the pattern?
We also know each worker’s degree, usual hours, and whether they work in the public or private sector. Which would you investigate first, and what would you calculate or plot?
Could education explain it?
Do men and women in this sample have the same mix of bachelor’s and master’s degrees?
Calculate the conditional degree distribution within each sex.
Report the fraction with master’s degrees for women and for men.
Education in our sample
About 40% of women and 32% of men hold master’s degrees.
Look within each degree
Use the full acs table to make age plots separately for bachelor’s and master’s graduates. What needs to change in the grouping and plot?
Add one grouping variable
Does the pattern persist?
The gap is larger among older workers within both degree groups.
Could working hours explain it?
Annual pay might differ because people work different amounts.
hours records usual weekly hours; weeks records weeks worked.
Calculate hourly_pay from pay, hours, and weeks, with pay converted to dollars.
Report median weekly hours and hourly earnings by sex.
What did hours account for?
Do these results support working hours as the main explanation for the annual earnings gap? Cite a number in your answer.
Does the workplace matter?
sector identifies private employment or public employment (local, state, or federal government).
We want median earnings by sex, separately for each sector.
What would you change in the overall summary to make this table? What plot would you use to show the four medians?
Submit the workplace plot
Calculate median pay for men and women within each sector. Make and submit a plot showing all four medians. Which sector has the larger dollar gap?
Public and private employment
The gap is about $20,000 in private employment and $8,000 in public employment.
What would you investigate next?
Suggest one further analysis that would help explain the smaller public-sector gap. Use a variable we have and describe the table or plot you would make.
Optional: does the gap differ by occupation?
We have the occupation codes. The names are in a separate table.
Let’s investigate software developers, systems analysts, operations research analysts, and computer support specialists.
Join, summarize, reshape, rank
Calculate median_pay for each occupation and sex.
Put Male and Female median_pay on the same row for each occupation.
Calculate gap as Male minus Female and sort from largest to smallest.
The occupation results
What would you report?
Write one sentence about the historical trend, one about the same-job age pattern, and one about the earnings distribution. Include a number and suggest one next investigation.
What did we practice?
Predict a pattern before calculating it.
Investigate with grouped summaries, reshaping, joins, and plots.
Interpret ratios and the two lines in an indicator model.
The following slides preserve what students submitted during class. No names or login information are included.
CLASS RECORD · QUESTION 1
What do you think that percentage was in 2024? Enter a number between 0 and 100.
76 anonymous responses
Other responses76
QUESTION 1 · Other responses · 1/9
Student responses
100
20
40
40
55
67
67
68
70
QUESTION 1 · Other responses · 2/9
Student responses
70
71
72
72
72
72
73
73
74
QUESTION 1 · Other responses · 3/9
Student responses
75
75
75
75
75
75
75
75
75
QUESTION 1 · Other responses · 4/9
Student responses
75
75
75
75
76
78
80
80
80
QUESTION 1 · Other responses · 5/9
Student responses
80
80
80
80
80
80
80
80
80
QUESTION 1 · Other responses · 6/9
Student responses
80
81
81
82
82
82
82
83
83
QUESTION 1 · Other responses · 7/9
Student responses
84
84
85
85
85
85
85
85
85
QUESTION 1 · Other responses · 8/9
Student responses
85
88
88
89
90
90
90
90
90
QUESTION 1 · Other responses · 9/9
Student responses
92
95
95
99
CLASS RECORD · QUESTION 2
- Plot median earnings against year, with a different color for each sex. - Connect each group's earnings over time with a line. - Make separate panels for bachelor's and master's degree holders.
75 anonymous responses
Other responses75
QUESTION 2 · Other responses · 1/13
Student responses
college_history
college_history
college_history |>
ggplot(aes(x=year, y=pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history
college_history |>
ggplot(aes(y=pay, x=year, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = time , y = pay , color = sex )) +
geom_line() +
facet_wrap(~ pay) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = time, y = pay, color = red)) +
geom_line() +
facet_wrap(~ degree) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = time, y = pay, color = sex)) +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = time, y = pay)) +
geom_line(aes(color = sex)) +
facet_grid(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
QUESTION 2 · Other responses · 2/13
Student responses
college_history |>
ggplot(aes(x = time, y = pay)) + geom_line(aes(color = sex))
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year , y = pay)) +
geom_line(aes(color = sex)) +
facet_grid(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year , y = pay)) +
geom_line(aes(color = sex)) +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay , color = sex)) +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex )) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex, group = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(
x = "Year",
y = "Median pay ($1,000s)",
color = "Sex"
)
QUESTION 2 · Other responses · 3/13
Student responses
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)",
color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(
x = "Year",
y = "Median pay ($1,000s)",
color = "Sex"
)
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(
x = "Year",
y = "Median pay ($1,000s)",
color = "Sex"
)
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
QUESTION 2 · Other responses · 4/13
Student responses
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
QUESTION 2 · Other responses · 5/13
Student responses
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
QUESTION 2 · Other responses · 6/13
Student responses
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line(aes(color = sex)) +
facet_grid(~ education)
QUESTION 2 · Other responses · 7/13
Student responses
college_history |>
ggplot(aes(x = year, y = pay, color = sex)) +
geom_line() +
facet_wrap(~education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay, color = wrap)) +
geom_line(aes(color = sex)) +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay) +
geom_line(aes(color = sex)) +
facet_grid(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay) +
geomline(aes(color = sex))
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay)) +
geom_line(aes(color = sex)) +
facet_grid(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |>
ggplot(aes(x = year, y = pay)) +
geom_line(aes(color = sex)) +
facet_grid(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
QUESTION 2 · Other responses · 8/13
Student responses
college_history |>
ggplot(aes(x = year, y = pay)) +
geom_line(aes(color = sex)) +
facet_wrap(~ education) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
college_history |> ggplot(aes(year, earnings, color = sex)) +
geom_point() +
geom_line() +
facet_wrap(~ degree) +
labs(x = "Year", y = "Median pay ($1,000s)", color = "Sex")
QUESTION 2 · Other responses · 13/13
Student responses
ggplot(paygap, aes(x = year, y = median_earnings, color = sex, group = sex)) +
geom_line() +
geom_point() +
facet_wrap(~ degree) +
labs(
x = "Year",
y = "Median earnings",
color = "Sex"
)
CLASS RECORD · QUESTION 3
Suppose median earnings double for both groups. What happens to the dollar gap? What happens to women's earnings as a fraction of men's earnings? Which would you plot across these decades?
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 4 · 1/2
How would you turn the previous table into this one? Describe the steps or name the command you would use.
76 anonymous responses
Use pivot wider / pivot_wider55Responses recommending widening the table (pivot wider) to reshape from long to wide format.
Use summarize / aggregate7Responses suggesting summarizing or aggregating the data as the step to change the table.
Other responses6
Compute a ratio variable4Response proposing to create a new ratio variable rather than reshaping the table.
CLASS RECORD · QUESTION 4 · 2/2
Response themes for question 4
Use pivot longer / pivot_longer4Response recommending pivoting to a longer format, specifying which columns supply names and values.
QUESTION 4 · Use pivot wider / pivot_wider · 1/7
Student responses
First pivot wider, with categories coming from sex and pay values coming from pay. Then divide
I would group by year, pivot sex wider
i would use pivot wider, names_from = gender, values_from = pay. then you can use mutate to create a new column with a gap
I would use pivot_wider
I would use pivot_wider() in R to turn the gender values into separate columns (Female and Male), while keeping year and education as they are.
I would use pivot_wider() so the Female and Male values become separate columns on the same row for each year and education level.
I would use pivot_wider() to turn the sex values into separate Female and Male columns, with their earnings as the values.
I'll use pivot_wider function. column_from = sex and value_from = pay.
One way that I would turn the previos table into this one would be to use pivot wider, as we need to go wider.
QUESTION 4 · Use pivot wider / pivot_wider · 2/7
Student responses
pivot _wider
pivot longer
pivot wider
pivot wider
pivot wider
pivot wider
pivot wider
pivot wider
pivot wider
QUESTION 4 · Use pivot wider / pivot_wider · 3/7
Student responses
pivot wider
pivot wider
Pivot wider
pivot wider by sex values to female and male
pivot wider to form new columns for female pay and male pay, so each entry has pay for both sexes.
Pivot wider with gender being the col name and median pay being the values
pivot wider, column names from sex, value from pay
pivot wider, value = pay, names from sex
Pivot Wider!!! HEHEHE I supposed I would pivot to use female and male as new columns. Afterwards I would filter out desired years.
QUESTION 4 · Use pivot wider / pivot_wider · 4/7
Student responses
pivot_longer
Pivot_longer but keep year and education in place, so that female and male move from values in the table to column titles
pivot_wide
pivot_wide
pivot_wide with names_by sex and value_by pay
pivot_wider
pivot_wider
pivot_wider shows the wider table of the information we need
pivot_wider() create separate columns for female and male earnings, then use mutate() to calculate the female-to-male earnings ratio
QUESTION 4 · Use pivot wider / pivot_wider · 5/7
Student responses
Pivt wider, names from sex and values from pay
Take the sex column and pivot wider over two new columns.
To do this we would need to use pivot_wider so that it is split into two columns, one for each gender.
To turn it into this table, you use the pivot_wider function to make female and male into columns.
use piviot widers
use pivot wider
use pivot wider
use pivot wider
use pivot wider to combine
QUESTION 4 · Use pivot wider / pivot_wider · 6/7
Student responses
Use pivot_wider with Male and Female as the new columns and pay as the data
Use pivot_wider, with names_from "sex", and values_from "pay"
use pivot_wider() to make sex into columns.
Use pivot_wider() to turn the sex values into separate Female and Male columns containing median earnings, keeping year and education as the row identifiers.
We would use pivot wider to make the table have the male and female as columns
we would use pivot_wider so that the sex groups become two separate columns, names_to would Female/Male, values from sex
wider
wider
would want to pivot wider on year
QUESTION 4 · Use pivot wider / pivot_wider · 7/7
Student responses
You could group by year, then pivot wider to get the pay for each gender in the same row.
QUESTION 4 · Use summarize / aggregate · 1/1
Student responses
group by year, pivot wider
I would reshape the data from long to wide format using pivot_wider
summarize
Use left_join and pivot_wider
we first need to turn the female row with its male row into columns using year and education
You could add a column using the mutate function and then summarize the results using summarize function
You would have to group by year. and pivot wider
QUESTION 4 · Other responses · 1/1
Student responses
1. make a wider plot 2. calculate the percentage in mutate
QUESTION 4 · Use pivot longer / pivot_longer · 1/1
Student responses
groupby education, select sex, and pivot longer
pivot_longer, with names from sex and values from pay
Pivot_wider()
You would need to pivot the table to change the format using pivot_longer
CLASS RECORD · QUESTION 5
Put male and female pay on the same row for each year and education level.
71 anonymous responses
Other responses71
QUESTION 5 · Other responses · 1/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in%
c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(
ratio = Female / Male
)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree",
"Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(
names_from = sex,
values_from = pay)
# endfold
mutate(ratio = Female / Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree",
"Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay) |>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 2/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(
names_from = sex,
values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = ______, values_from = ______)
# endfold
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
pivot_wider(
names_from = sex,
values_from = pay
) |>
mutate(pay_ratio = Female / Male)
history_work |> head(3)
QUESTION 5 · Other responses · 3/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = gender, values_from = earnings)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 4/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay) |>
mutate(ratio = Female/Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay)|>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 5/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay) |>
mutate(ratio= Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex,
values_from = pay)|>
# endfold
mutate(ratio = Female / Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = earnings)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 6/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = mediam)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
history_work <- history_work |>
mutate(pay_ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 7/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 8/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
history_work |> mutate(ratio = Female / Male)
# ratio is the fraction of women's pay compared to men
QUESTION 5 · Other responses · 9/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
mutate(ratio = Female/Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
|> mutate(pay_gap = Female/Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)
# endfold
mutate(ratio = Female/Male)
history_work |> head(3)
QUESTION 5 · Other responses · 10/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(
ratio = Female / Male
)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(
ratio = Female / Male * 100
)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate( ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 11/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 12/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 13/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 14/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 15/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(Ratio = Female/Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
mutate(ratio = Female / Male)
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(pay_ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 16/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 17/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 18/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 19/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 20/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ration = Female / Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 21/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |> mutate(fraction = Female/Male)
# endfold
# Again this was created by doing female/male
history_work |> head(3)
# The calculation of male to female was created with female/male
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)|>
mutate(ratio = Female/Male)
# endfold
history_work |> head(3)
QUESTION 5 · Other responses · 22/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)|>
mutate(ratio= Female/Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)|>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)|>
mutate(ratio = Female/Male)
history_work |> head(3)
QUESTION 5 · Other responses · 23/24
Student responses
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay)|>
mutate(ratio=female/male)
# endfold
history_work |> head(3)
history
# fold: [Keep the college graduates]
history_work <- history |>
filter(education %in% c("Bachelor's degree", "Master's degree")) |>
# endfold
# fold: [Put male and female earnings on the same row]
pivot_wider(names_from = sex, values_from = pay) |>
mutate(ratio = Female / Male)
# endfold
history_work |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex,
values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = ______)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male )
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 2/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male * 100)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = female / male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = female / male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 3/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 4/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 5/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 6/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 7/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 8/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 9/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 10/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 11/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female / Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 12/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/ Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/ Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 13/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 14/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
QUESTION 6 · Other responses · 15/15
Student responses
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio = Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
# fold: [Keep college graduates and put their earnings side by side]
history_work <- college_history |>
pivot_wider(names_from = sex, values_from = pay) |>
# endfold
# fold: [Calculate women's pay as a fraction of men's pay]
mutate(ratio =Female/Male)
# endfold
history_work |> select(year, education, ratio) |> head(3)
CLASS RECORD · QUESTION 7
Plot the female/male earnings ratio over time for both education levels. Submit your plot. State whether the gap has closed by 2024.
58 anonymous responses
Other responses58
QUESTION 7 · Other responses · 1/8
Student responses
QUESTION 7 · Other responses · 2/8
Student responses
QUESTION 7 · Other responses · 3/8
Student responses
QUESTION 7 · Other responses · 4/8
Student responses
QUESTION 7 · Other responses · 5/8
Student responses
QUESTION 7 · Other responses · 6/8
Student responses
# fold: [Plot the earnings ratio for each education level] history_gap |> ggplot(aes(x = year, y = ratio, color = education)) + geom_line() + # endfold # fold: [Mark equal earnings and label the axes] geom_hline(yintercept = 1, linetype = "dotted") + labs(x = "Year", y = "Female / male pay", color = "Education")
# fold: [Plot the earnings ratio for each education level] history_gap |> ggplot(aes(x = year, y = ratio, color = education)) + geom_line() + # endfold # fold: [Mark equal earnings and label the axes] geom_hline(yintercept = 1, linetype = "dotted") + labs(x = "Year", y = "Female / male pay", color = "Education") # endfold
history_gap |> ggplot(aes(x = year, y = ratio, color = education)) + geom_line(linewidth = 1.2) + geom_hline(yintercept = 1, linetype = "dashed", color = "gray50") + scale_y_continuous(labels = scales::label_number(accuracy = 0.01)) + scale_color_brewer(palette = "Dark2") + labs( x = "Year", y = "Female / male pay ratio", color = "Education", title = "Female-to-male earnings ratio over time" ) + theme_minimal() + theme( legend.position = "top", plot.titl
QUESTION 7 · Other responses · 7/8
Student responses
i made the y = ratio the color = education
no, the gap has not closed by 2024.
No, the gap has not closed since neither line reaches 1.
The gap has closed between masters and bachelors but not from male and female
the gap has grown a little looking at 2024, but mostly stayed the same.
The gap has not closed by 2024. It essentially has remained almost static.
The gap has not closed, women still make ~70% of what men make
The gap is not really narrowing, it seems to be flat around 70%.
The gap isnt changing
QUESTION 7 · Other responses · 8/8
Student responses
The pay gap appears to be very similar for the different education levels, and it appears to be stable at about 0.7.
CLASS RECORD · QUESTION 8
How did the gap change for each education level? Did more education correspond to a smaller gap in 2024? Use the ratios in your answer.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 9 · 1/2
Choose an education group. What would you regress on what? How would you use the fitted line to estimate the year of equal earnings?
78 anonymous responses
Regress earnings ratio on year37Suggests modeling the female-to-male earnings ratio against year and solving the fitted line for ratio = 1 to estimate the equal-earnings year.
Identify an education group19Mentions which education group to analyze (e.g., college graduates) without specifying regression details or estimating method.
Express uncertainty6States uncertainty or inability to answer; no modeling choice or education group given.
Ambiguous: regress ratio or gender/pay5Unclear statements that mention regressing ratio but mix up predictors (e.g., regress ratio on gender or regress bachelors on ratio) or lack clarity about variables.
CLASS RECORD · QUESTION 9 · 2/2
Response themes for question 9
Other responses4
Regress pay on education and/or year4Mentions regressing pay (income) on education level or year, rather than explicitly using the earnings ratio or solving for equal-earnings year.
Specify linear model3Proposes using a straight line (linear regression) but does not state which education group or how to find the equal-earnings year.
QUESTION 9 · Regress earnings ratio on year · 1/5
Student responses
bachelor's as group. Would regress pay ratio with time. By taking it when equals 1
Create a regression line for ratio against time, and we would want to see when the regression line reaches 1.
For bachelor’s degree holders, regress the female/male earnings ratio on year
For masters student you could regress ratio on year and see when it will reach one
I select the bachelor's degree group because there seemed to be more of a change. I would use a linear regression because it seems to change approximately linearly. I would use the slope and intercept to calculate the estimated earning.
I would choose Bachelors as my education group, and I would regress the ratio of pay between men and women. I would try to see if there is a negative relationship that trends towards 1
I would choose the bachelor's degree group and regress the female-to-male earnings ratio on year. Then I would use the fitted regression line to find the year when the predicted ratio equals 1.
I would regress earnings ratio on year to get a fitted line to estimate the year where the ratio is equal to 1.
QUESTION 9 · Regress earnings ratio on year · 2/5
Student responses
I would regress female_pay/male_pay by year, to see if the ratio has a change related to time.
I would regress on ratio and use the fitted line to estimate the year of equal earnings
I would regress on ratio. If the predicted ratio is 1, then the year of equal earnings is estimated.
I would regress on year to predict pay ratio
I would regress ratio (the pay gap) on year, then set the resulting equation to 1 and solve.
I would regress ratio on time for a master degree.
I would regress ratio on year, and I would find where the fitted line reaches 1 on the y axis in order to estimate the year of equal earnings.
I would regress the female-to-male earnings ratio on year. Then I would set the predicted ratio equal to 1.
I would regress the female/male earnings ratio on year for one education group, then use the fitted line to find the year when the predicted ratio reaches 1.
QUESTION 9 · Regress earnings ratio on year · 3/5
Student responses
i would regress the ratio compared to the year, showing a line of best fit and finding where its y val hits 1 so the ratio is one
I would regress the ratio on time with just bachelors. When the intercept + slope = 1 is the tie when they are estimated equal earnings
I would regress the ratio over time to see its change. I would use the fitted line to estimate when the ratio will get to one
I would regress using the ratio on year. Use the fitted line until ratio is = 1.
I'm choosing the Bachelor's group and use a linear regression to regress pay ratio by year and predict pay gap by year.
Lets go with bachelors since thats the most common. I think I would regress on ratio over time and we would esssentially regress until ratio equals 1
Master's degree, regress ratio on year, look at the slope and intercept to predict the year when ratio=1
regress on the ratio, the fitted line , the slope can be used to make a prediction
Regress pay ratio on year. Predict when median pay would be equal by finding the year when the regression equals one.
QUESTION 9 · Regress earnings ratio on year · 4/5
Student responses
regress ratio on time, then use model to predict when the ratio will equal 1
regress ratio on year and see when the line crosses the horizontal line at 1
Regress ratio on year. Use the fitted line until ratio = 1
regress the pay ratio gap to time. fitted line would show future predictions of the ratio until it intersected with 1
Regress the wage gap on time for bachelor's degrees, for example. We can see what time needs to be for the ratio to be one.
relate ratio to year for bachelor's degree using a linear model. Use the fitted line to determine the predicted year where the ratio is 1.
run a model on ratio x time, then given the estimated reggression line, we could see when that regression line equals 1
Use bachelor degrees. Run a linear regression on the gap
we would have to regress ratio on year?
QUESTION 9 · Regress earnings ratio on year · 5/5
Student responses
You can regress ratio as the Y and time as the X. Then you could your fitted line, and solve for the time (year) that the value of the fitted line equals 1.
you would regress the ratio onto year.
QUESTION 9 · Identify an education group · 1/3
Student responses
BA
bachelor's---regress on earning ratio?
Bachelors
Bachelors, I would regress on pay
Bachelors, regress on pay, by looking at the patterns
College graduates
For bachelor degree, the ratio is growing faster, which means the gap between female and male is closing to 1
For bachelors degree, I would regress the ratio on the year
I choose bachelor, I would use something like lm(ratio ~t) and estimate earnings.
QUESTION 9 · Identify an education group · 2/3
Student responses
i choose bachelors, i would regress average pay by gender group who only have a bachelors. i would see when the two lines intersect to see when the gender gap closed/will close
I would choose bachelors and regress on pay per year
I would choose the Bachelor's degree for female. I would use past eranings to predict the future.
I would choose the bachelor's degree group and regress the female-to-male earnings ratio on year. Then I would use the fitted regression line to find the year when the predicted ratio reaches 1, since that represents equal median earnings.
i would regress sex on pay
I would regress the ratio based on bachelors degree candidates and see how the ratio has changed between male and females
I'll choose Bachelor's Degree, and I'd regress pay on sex. The fitted line would estimate the gap based on the year.
If i chose bachelors, run linear regression based on pay to see if there is a trend
Looking at the education group of Master's Degree, I would regress to see when the ratio is predicted to equal one.
QUESTION 9 · Identify an education group · 3/3
Student responses
Using bachelor's degrees, I would regress pay on year and use the final linear equation to see what the predicted year is when we reach a ratio of 1.
QUESTION 9 · Express uncertainty · 1/1
Student responses
bachlor's I would regress pay on gender and time
HAving a headache rn, i cant think
i would regress pay (y) on education (x). i would use the fitted line to estimate the year of equal earnings but setting line regresison to 1
idk
unsure
We want to predict what the ratio of earnings between men and women is based off whether they have a bachelor's degree. Use the fitted line to draw it up to see when it hits 1 according to the model
QUESTION 9 · Ambiguous: regress ratio or gender/pay · 1/1
Student responses
group 2
i would regress earnings ratio on year so ican see how the ratio changrs over time
i would regress ratio on gender or pay
on different edu group
regressing the pay ratio itself on year to estimate the year of equal earnings using the fitted lin
QUESTION 9 · Other responses · 1/1
Student responses
bachelor's degree. I would regress on ratio ~ year. I'll use the R-squared value to see the correlation.
I would regress the effect of the classification of gender and maybe year after graduation to measure the earnigngap
I'd choose masters. I'd regress on the difference in pay, and check when that reaches 0. Could also do it on the pay ratio, and check when ratio = 1.
We would test to see if there is a difference between the two groups by using a statistical test. If the ratio = 1 for both of the groups, we can conclude that the gap doesn't exist.
QUESTION 9 · Regress pay on education and/or year · 1/1
Student responses
education level and income
I think I will run regression based on the their sex and education and predict their payment
i would regress on pay on the year
I would regress on the pay, separated for females and males.
QUESTION 9 · Specify linear model · 1/1
Student responses
a straight line can be used. if i choose my education group to be bachelor degree holders
Linear regression to find equation, then solve for the year when y=1
Use linear regration
CLASS RECORD · QUESTION 10 · 1/2
Set the earnings ratio to 1 and solve for the year. How far beyond our last observation is that?
80 anonymous responses
Far future year around 2143–214454Responses giving a calendar year in the mid-2100s as the solution (explicit years 2143 or 2144).
Years beyond last observation in decades/centuries8Response stating how long after the last observation this occurs, expressed as a duration (about 153 years after 1991).
Year stated without context or ambiguous5Very short or ambiguous numeric responses that give a number without explicit year context.
Algebraic expression for calculation4Responses giving the algebraic formula or calculation to obtain the year without a final numeric simplification.
CLASS RECORD · QUESTION 10 · 2/2
Response themes for question 10
Cautionary or qualitative comment about reliability4Responses that state the predicted year and explicitly note the long extrapolation or reliability concerns.
Decimal-year precision around 2143.633Responses providing a more precise decimal-year estimate near 2143.63.
Other responses2
QUESTION 10 · Far future year around 2143–2144 · 1/6
Student responses
~2143
21
2143
2143
2143
2143
2143
2143
2143
QUESTION 10 · Far future year around 2143–2144 · 2/6
Student responses
2143
2143
2143
2143 is the year
2143 which is 119 years past our last observation
2143, about 120 years from now
2143, about 120 years from the end of the data
2143, it is around 120 years later beyond 2024
2143.62932877
QUESTION 10 · Far future year around 2143–2144 · 3/6
Student responses
2143.63, so far beyond
2144
2144
2144
2144
2144
2144
2144
2144
QUESTION 10 · Far future year around 2143–2144 · 4/6
Student responses
2144
2144
2144
2144
2144
2144, 120 years after the last observation
2144, 120 years past last observed
2144, subtract the last year in daga from 2144
2144, which is 120 years passed our last observation
QUESTION 10 · Far future year around 2143–2144 · 5/6
Student responses
about 2100
About 2143. This is about 120 years after our last observation
around 2144
At 2144, which is almost 120 years after our last observation.
giving year ≈ 2144. That is about 120 years beyond the last observation (2024).
part way through the year 2143
The earnings ratio will hit one in 2143.
The estimated parity year is 2144
The model predicts parity around 2144, about 120 years beyond the last observation in 2024.
QUESTION 10 · Far future year around 2143–2144 · 6/6
Student responses
The resulting year is around 2143. That's far beyond now.
the year 2144
The year is about 2143.
the year is predicted to be 2144.
The year would be 2143.
the year would be 2144, or 120 years after our last prediction.
We are estimated to reach a ratio of 1 in 2,143. This is about 128 years beyond our last observation.
year 2143
year 2144
QUESTION 10 · Years beyond last observation in decades/centuries · 1/1
It is projected to hit 1 in 2143, 152 years after 1991.
like 153 years, really beyond
QUESTION 10 · Year stated without context or ambiguous · 1/1
Student responses
10
2143 would be the year the gender pay gap closes. its about 152 years away from 1991
2144. 153 years later than 1991
it would be 0.6430 + 0.002339 X (2025 - 1991),, I think it would be aorund 90%
So the model predicts the earnings ratio reaches 1 around the year 2144. If the last observation was 2016, then this is about 2144 − 2016 = 128 years beyond the last observation.
QUESTION 10 · Algebraic expression for calculation · 1/1
Student responses
((1 - 0.6430)/0.002339)+1991 = year
((1-0.6430)/0.002339) + 1991 = 2144
(1-0.643)/0.002339 + 1991
0.6430+0.002339×(year−1991)=1 solve and get year=2144, that so far away
QUESTION 10 · Cautionary or qualitative comment about reliability · 1/1
Student responses
about 120 years beyond our last observation in 2024. This is a large extrapolation, so it assumes the straight-line trend continues far outside the observed data,
not for a very very very long time. like a ridiculously long time.
The model predicts earnings parity around 2144, which is approximately 120 years after our last observation in 2024. This is a long extrapolation, so the prediction may not be very reliable.
The model predicts equal earnings around 2144, which is about 120 years after the last observation in 2024.
QUESTION 10 · Decimal-year precision around 2143.63 · 1/1
Student responses
2143.63
Set 1 = 0.6430 + 0.002339*(year - 1991). So year - 1991 = 0.357/0.002339, which is about 153, so year is about 2144. Our last observation is 2024, so that's roughly 120 years beyond the data.
Setting ratio to0, year-1991=152
CLASS RECORD · QUESTION 11
This fit uses 2000–2024. Use its coefficients to get another parity year. Would you report either year as a precise prediction? Explain.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 12
- Group the workers by sex and report n and median_pay for each group. - Report the difference in median earnings in dollars.
77 anonymous responses
Other responses77
QUESTION 12 · Other responses · 1/19
Student responses
# fold: [Calculate each group's sample size and median pay]
summary_work <- acs |>
group_by(______) |>
summarize(n = n(), median_pay = median(______), .groups = "drop")
# endfold
summary_work
summary_work <- work |>
group_by(sex) |>
summarize(
n = n(),
median_pay = median(pay, na.rm = TRUE)
)
summary_work
max(summary_work$median_pay) - min(summary_work$median_pay)
# fold: [Calculate each group's sample size and median pay]
summary_work <- acs |>
group_by(sex) |>
summarize(
n = n(),
median_pay = median(pay), .groups = "drop")
# endfold
mp <- summary_work$median_pay
mp[2] - mp[1] #median pay difference
After keeping one job and degree, do you expect a similar pay gap among workers in their twenties and workers in their forties? Explain. What would you plot to check it?
83 anonymous responses
Accumulation widens gap over time13Students believe small initial differences compound over careers, producing a larger pay gap in older age groups.
Gap decreases when role and degree fixed13Students expect a smaller pay gap if workers keep the same job and degree, attributing similarity in pay to identical roles or qualifications.
Gap may widen due to sexism11Students suggest the pay gap could grow with age because of gender-based raises or discriminatory practices favoring men.
Removing confounders reduces gap11Students argue that controlling for confounding variables (by holding job and degree constant) should reduce observed pay differences between age groups.
CLASS RECORD · QUESTION 13 · 2/2
Response themes for question 13
Affirms question without detail9Very short responses that simply answer yes or give minimal affirmation without explanation or plotting suggestions.
Depends on job, degree, and other factors9Students emphasize conditionality: outcomes vary by job, degree, and other factors rather than a single uniform effect.
Older workers earn more9Students expect higher pay for older workers, citing experience or age-related pay increases as reasons for a larger gap.
Plot medians or lines by age and gender8Students recommend plotting median earnings against age or using separate lines/groups for men and women to visualize pay differences.
QUESTION 13 · Accumulation widens gap over time · 1/2
Student responses
I expect a bigger pay gap among workers in their forties
I expect a gap smaller in the 20s compared to the 40s, as workers in their 40s may still be dealing with worse subconsious effects from the older larger pay gap
I expect a larger one, because when staying longer, people know each other better and those with better skills wibb be paid more.I would try to plot the pay gap use box plot
i expect a larger pay gap between those in their forties because theres more opportunity for increases between 20 and 40. would us a histogrsm to look at it
I expect the pay gap to decrease, but I don't expect it to close. I anticipate that the gap will increase as age increases. I would plot pay gap vs age
I would expect the pay gap to be larger for workers in their forties because differences can build over time, and I would plot pay against age with separate lines or groups for men and women.
I would imagine that the pay gap would increase over time, since there's a greater variation of pay at senior positions as opposed to entry-level positions. Differences in family dynamics would also factor
QUESTION 13 · Accumulation widens gap over time · 2/2
Student responses
I’d expect a larger pay gap among workers in their forties, because differences in promotions, experience, and career breaks could accumulate over time.
no I would expect a greter pay gap in their forties because there are more factors that may affect a carreer
No, I would expect the gap to be smaller for workers in their twenties and larger for older workers. Early on people in the same job/degree start more similarly, but differences in promotions, raises, and time out for caregiving can accumulate with age.
probably smaller gap among workers in their 20s and a larger gap among workers in their 40s, because it accumulate with time.
Would expect pay gap to differ, since people in better higher income jobs in 20s eventually make way way more than people in worse low income jobs.
Yes because they increase at the same rate. Plot the amount people in the same field earn after years in their field and compare the rates
QUESTION 13 · Gap decreases when role and degree fixed · 1/2
Student responses
I expect that the pay gap would decrease
I expect the gap will be smaller because you are focusing on just one area instead of a wide ranging list of jobs
I suspect it will be smaller, but will not converge to 1. Men were accepted in STEM fields earlier, thus the ratio of men to women in stem fields is likely higher in higher age groups. People in the industry tend to make more money earlier, thus my expectation.
I think the gap could differ by age and also the gap would decrease when the role and degree is fixed
I think the gap will be smaller, since female dominated carrers do tend to pay less, but also there probably is still some gap
I think the pay gap will decrease
I think the pay gap will get smalller.
I would imagine that the pay gap would shrink because a big difference in the pay gap between young and old workers is their job.
pay gap will stay smaller, i would filter job and degree lok at each correlated plot it out male vs female and se if that expands or doesnt
QUESTION 13 · Gap decreases when role and degree fixed · 2/2
Student responses
probably a gap smaller when they are older because then it is much more about how good you are at your job
Probably, because there may be different levels of that particular job. Like SWE I vs SWE II for example. I would check the actual role.
Smaller since it is the same roles
The pay gap will likely decrease. There will be less education disparity and less skill differences.
QUESTION 13 · Gap may widen due to sexism · 1/2
Student responses
different pay gap
I don't expect a similar pay gap among workers in their twenties and those in forties due to difference in working experience. I would plot a scatter plot to check it.
I don't think the pay gap would be the same. Workers in their forties may have a larger pay gap because differences in promotions, career progression, and work experience can accumulate over time. I would plot average salary by age group and gender, keeping the job and degree the same, to compare the gaps.
I expect a similar pay gap because workers in their forties typically have more tenure and are more likely to be promoted. i would plot a ggplot
I think that the pay gap might increase as age increases because interns or entry level positions will probably pay similarly between genders but older people will get higher positions and with that some sexism could come into play when deciding salaries and such
QUESTION 13 · Gap may widen due to sexism · 2/2
Student responses
I think the age gap remains the same or even gets wider because men are often given promotions over women. I would filter the data by job and degree and then create a line plot with each line representing a different age group.
I think the pay gap will get bigger as people age as men may be getting larger raises than women. I would plot a line plot, plotting pay gap by year colored by sex
I think the pay gap will get bigger for workers in their forties as men are more likely to get raises and pay bumps due to sexism.
I think the pay gap would be larger because people with more experience are paid better and generally, women have kids, take materity leave, which hurts their chances of getting a promotion and staying with the company for that long. I would visulaize this with a boxplot
i would expect the increase to be more, because males might be more likely to get promoted. I would plot median pay by sex over different age groups.
I would not expect a similar gap. I would expect the gap to be smaller for younger people because there were more barriers for women in the past
QUESTION 13 · Removing confounders reduces gap · 1/2
Student responses
Hopefully it'll get smaller because it'll get rid of confounding variables that could affect the pay difference.
I expect the pay gap will get smaller as people age, because raises and promotions may close the gap.
I think the gap could differ by ages, as older women are less likely to take time off for childcare once they are past that point, which is a big "argument" for the pay gap. To check it, I would plot age ranges against each other.
i think the gap will increase as workers get older because men will receive higher pay raises.
i would expect an enlarger paygap, and I have graph two line plots to check it
I wouldn't expect the same because experience could be a confounding factor. To check it, I would plot median pay by sex separately for workers in their twenties and workers in their forties, while keeping job and degree fixed.
If we removed confounds, the gap would most likely decrease.
no I dont expect a pay gap, i would use a line plot to plot the difference
probably higher pay for older people due to bonuses and promotions they may have received throughout their career
QUESTION 13 · Removing confounders reduces gap · 2/2
Student responses
The pay gap should be smaller among workers in their twenties because workers in their 40s are probably more likely to be male.
Yes, we can plot the both of them out
QUESTION 13 · Affirms question without detail · 1/1
Student responses
I think the larger the age is, the larger the gap would be. Because as women grow old they would be discriminated more due to family issues? I would plot line chart to check it
I think the pay gap would be larger for people in their forties.
I would expect a similar pay gap because both would be on an even playing field in terms of degree. I would plot the pay over time.
i would expect it to remain the same given data tweve seen that the pay gap hasnt really changed. i would plot pay gap vs years of experience to check
I would expect the pay gap to be different between age groups. The people in their 40s properly have a bigger salary difference.
yeas
yes
yes
Yes. Plot filtering on ages
QUESTION 13 · Depends on job, degree, and other factors · 1/2
Student responses
Depends on the job and degree but overall I would say, other factors do matter
I expect certain job the pay gap would be enlarged. and at their forties, I expect pay gap is larger, plot, historgram
I expect the pay gap among workers in their twenties and workies in their forties to be slightly different, since it may be more likely for employers of new hires to attempt to close the pay gap
I expect the pay gap could widen because if men are better positioned, they could be the ones to get promotions. To check this, I would create separate groups for age and plot this
I think keeping only 1 job and degree depending on the job, i think the pay gap would differ, some fields
I think that the gap will remain relatively the same and decrease maybe slightly. I think that people just entering the workforce will be paid more similarly but that this gap will widen as they go further on in their career.
I think the pay gap will stay relatively the same, we should expect that these pay gaps will remain constant. I would do a scatter plot again
QUESTION 13 · Depends on job, degree, and other factors · 2/2
Student responses
It will preobably differ by age since older women are less likely to take maternity leave etc, and have more experience. to make a plot, filter by age as well on a line.
No I dont becdause life doesn change and the way promotions happen might play a role in how th egap chnages as well. ues a plot would be a good way to check this
QUESTION 13 · Older workers earn more · 1/1
Student responses
I think people in 30s will have a larger pay than people in 20s as they probably have more experience which probably makes them get paid way more
I think workers in their 40s will have a larger pay gap as salaries can grow in different rates.
i would expect a larger pay gap for older people
No, the younger people might get paid more for more complex jobs but the older people have probably been there longer
No. People in their forties are going to have more experience and their pay will reach a maximum amount
older workers may have higher pays since they have more experience, we can check by boxplot
Yes I think when the age is larger, the gap should be larger
Yes, because people earn promotions and raises over time, so older workers are likely to earn more. A line plot with median pay for workers over time, with one line for 20s workers and one line for 40s workers would show if there was a trend.
Yes, the people have more experiance will earn more
QUESTION 13 · Plot medians or lines by age and gender · 1/2
Student responses
I do not expect s similar pay gap would make a grouped boxplot of earnings by sex, comparing workers in their twenties and forties while keeping the job and degree the same
I don't expect the pay gap to be exactly the same. Workers in their forties may have a larger gender pay gap because of differences in work experience and career progression. I would use a boxplot to compare men's and women's earnings in their twenties and forties, keeping the same occupation and education level.
I expect a larger gender pay gap among workers in their forties because earnings may increase differently with age. I would plot median earnings against age.
I expect that the gap will be smaller among younger workers, as the gap is closing over time. I would plot these in two different graphs to see if this is true
I think there will be a gap for sure because you should expect to get paid more the longer you work in the industry. I think that the pay gap will get smaller for gender with age.
QUESTION 13 · Plot medians or lines by age and gender · 2/2
Student responses
I would expect a pay gap between workers in twenties and forties becuase workers in their forties have had more time to climb up the ladder and get a higher paying job with more experience. use a bar plot or line graph to show the difference in trends
I would expect the pay gap to be larger in their 40s because that is the time when jobs allow a huge pay gap between positions, in your 20s there is more of a baseline analyst salary. I would check it with 2 scatter plots.
No, I dont' think they would have the same pay.
CLASS RECORD · QUESTION 14
- Join occupation_names to acs and keep software developers with bachelor's degrees. - Calculate the number of workers and median pay for each sex and age. Call the columns n and median_pay. - Plot median pay by age, distinguishing men and women. Label the axes and include the pay units. - Add a code comment describing how the gap differs between workers in their twenties and forties.
83 anonymous responses
Other responses83
QUESTION 14 · Other responses · 1/64
Student responses
# acs |> select(occupation)|> print()
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
software_work |> print()
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x=age,y=median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: MY CODE COMMENT
# The gap begins between 30s and 45 and widens,
# then shrinks after 45
QUESTION 14 · Other responses · 2/64
Student responses
# Find software developers with a BA
software_work <- acs |>
left_join(occupation_names, by = "occupation") |>
filter(occupation_name == "Software developers",
degree == "Bachelor's")
# Summarize earnings by sex and age
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay),
.groups = "drop")
# Plot the age-specific medians
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age",
y = "Median pay (USD)",
color = "Sex")
# The gap appears smaller in workers' twenties and larger in their forties.
QUESTION 14 · Other responses · 3/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation") |>
filter(
occupation_name == "Software developers",
education == "Bachelor's degree"
)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(earnings, na.rm = TRUE),
.groups = "drop"
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age (years)",
y = "Median annual pay (dollars)",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# The pay gap between men and women is smaller among workers in their
# twenties and larger among workers in their forties.
QUESTION 14 · Other responses · 4/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
______
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
______
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 5/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
______
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:# Filter to software developers with the same degree
software_work <- acs |>
filter(occupation == "Software developers",
education == "Bachelor's degree",
age >= 20, age < 50) |>
mutate(age_group = if_else(age < 30, "20s", "40s")) |>
filter(age < 30 | age >= 40)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age_group) |>
summarize(median_earnings = median(earnings, na.rm = TRUE),
.groups = "drop")
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age_group, y = median_earnings, fill = sex)) +
geom_col(position = "dodge") +
labs(x = "Age Group", y = "Median Earnings",
title = "Median Earnings by Age Group and Sex")
# endfold
QUESTION 14 · Other responses · 6/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
______
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
developers <- acs |>
left_join(occupations, by = "occupation_code") |>
filter(occupation == "Software developers",
degree == "Bachelor's")
age_summary <- developers |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay, na.rm = TRUE),
.groups = "drop"
)
ggplot(age_summary, aes(x = age, y = median_pay, color = sex)) +
geom_line() +
geom_point() +
labs(
x = "Age",
y = "Median annual pay ($)",
color = "Sex"
)
# Compare pay gaps in the two age groups.
# Your answer:
# The gender pay gap is smaller among workers in their twenties
# and larger among workers in their forties.
QUESTION 14 · Other responses · 7/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
filter(education == ba)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
inner_join(
occupation_names,
by = "occupation_code"
) |>
filter(
occupation == "Software developers",
degree == "Bachelor's"
)
age_medians <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay),
.groups = "drop"
)
# endfold
# endfold
age_medians |>
ggplot(aes(x = age, y = median_pay,
color = sex)) +
geom_line() +
geom_point() +
labs(
x = "Age",
y = "Median pay ($1,000s)",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# The gender pay gap is smaller among workers in their twenties
# and larger among workers in their forties.
QUESTION 14 · Other responses · 8/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
inner_join(occupation_names) |>
filter(occupation == "Software Developer", degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: Pay gap differs
QUESTION 14 · Other responses · 9/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
inner_join(occupation_names) |>
filter(occupation == "Software developers", degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay), .groups = "drop")
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age", y = "Median pay ($)", color = "Sex")
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The pay gap between men and women is relatively small in their twenties, but widens significantly as workers reach their forties.
QUESTION 14 · Other responses · 10/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = 'occupation_code') |>
filter(
education == "Bachelor's",
occupation == "Software developers"
)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarise_(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line()
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 11/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occ_code") |>
filter(occ_name == "Software developers",
education == "Bachelor's degree")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay),
.groups = "drop")
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age (years)",
y = "Median annual pay (USD)",
color = "Sex")
# endfold
# Compare pay gaps in the two age groups.
# Your answer: In their twenties, men's and women's median pay is close;
# by their forties, men's median pay is noticeably higher, so the gap widens with age.
QUESTION 14 · Other responses · 12/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occ") |>
filter(
occ_title == "Software developers",
educ == "Bachelor's degree"
)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(incearn, na.rm = TRUE),
.groups = "drop"
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
geom_point() +
labs(
x = "Age (years)",
y = "Median annual earnings (US dollars)",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer: Among workers in their twenties, men's and women's median pay
# is close together, so the gap is small. By their forties the lines have
# pulled apart, and men earn noticeably more than women at the median.
# (Check this against your plot: the wording should match what you actually see.)
QUESTION 14 · Other responses · 13/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(degree == "Bachelor's" & occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay),
.groups = "drop"
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer: Pay gaps gradually become larger when people grow older.
QUESTION 14 · Other responses · 14/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(degree == "Bachelor's", occupation == "Software developer")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) + geom_line()
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 15/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(education == "Bachelor's",
occupation == "Software developers") |>
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(age, sex) |>
summarize(
n = n(),
median_pay = median(pay)
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: Pay gap increases
QUESTION 14 · Other responses · 16/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(occupation == "Software developers",
education == "Bachelor's degree")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay),
.groups = "drop")
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age", y = "Median pay ($)", color = "Sex")
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# The gender pay gap may be different between workers
# in their twenties and forties.
QUESTION 14 · Other responses · 17/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation") |>
filter(occupation_name == "Software developers", degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay),
.groups = "drop"
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
geom_point() +
labs(
x = "Age",
y = "Median pay (dollars)",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The pay gap between men and women can differ between workers in their twenties and forties.
QUESTION 14 · Other responses · 18/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by="occupation_code") |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(y = median_pay, x = age, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap appears to widen as people get older.
QUESTION 14 · Other responses · 19/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(education == "Bachelor's",
occupation == "Software developers") |>
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: In their twenties, women and men has similar median pay, so the gap is small
QUESTION 14 · Other responses · 20/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software Developers")
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
sumarize(n = n(), median_pay = median(pay))
# fold: [Plot the age-specific medians]
age_work |>
geom_line(aes(
x = age, y = median_pay, color = sex))
# Compare pay gaps in the two age groups.
# Your answer: the gap of twenties is lower than forties
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bacehlor's",
occpuation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 21/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bachelor's"
occupation == "Software developers"
)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n=n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes( x = age, y = median_pay,
color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:gap is bigger in 40s
QUESTION 14 · Other responses · 22/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bachelor's",
occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay,
color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The pay gap is usually small in workers' twenties but becomes much larger in their forties.
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bachelor's",
occupation == "Software developers") |>
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
age_work
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 23/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bachelor's",
occupation == "Software developers") |>
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by_(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
occupation == "Software developers",
degree == "Bachelor's")
software_work
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age) |>
summarize(n=n(),median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() +
geom_line(aes(x=age, y = median_pay))
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 24/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
occupation == "Software developers",
degree=="Bachelor's degree")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n= n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay,
color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 25/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's degree", occupation == "Software developers") |>
print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 26/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's",
occupation == "Software developer's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() +
geom_line(aes(
x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 27/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's") |>
filter(occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line()
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap is much smaller among workers in their twenties than workers in their forties.
QUESTION 14 · Other responses · 28/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == 'Software developers', degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: In their 20's the gap is very small/not there while in there 40's the gap is fairly large
QUESTION 14 · Other responses · 29/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developer",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay)
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap appears to increase as age increases
QUESTION 14 · Other responses · 30/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developer",
education == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() +
geom_line(aex(x = age, y = median_pay, color = sex))
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) >
summarize(median_pay = median(pay))
software_work
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aex(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 31/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize( n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: They differ as the pay gap is smaller for the older age group.
QUESTION 14 · Other responses · 32/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers", degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers", degree == "Bachelor's") |>
print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) + geom_line()
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 33/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers") |>
filter(education == "Bachelor's degree") |>
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software_bachelors",
degree == "Bachelor's")|> print()
# endfold
# fold: [Summarize earnings by sex and age]
# ##age_work <- software_work |>
______
# endfold
# # fold: [Plot the age-specific medians]
# age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 34/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
# endfold
filter(
degree == "Bachelor's",
occupation == "Software developers") |>
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bachelor's",
occupation == "Software developers"
)
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 35/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
degree == "Bachelor's",
occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x=age, y=median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:The pay gap seemed to increase from people in their twenties to 40s
QUESTION 14 · Other responses · 36/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
occupation == "Software developers",
education == "Bachelor's") |>
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's", occupation == "Software developers")
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: the gap is bigger
QUESTION 14 · Other responses · 37/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's", occupation == "Software developers") |>
print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap is greater between workers the older they are.
QUESTION 14 · Other responses · 38/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's", occupation == "Software developers") |> print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() +
geom_line(aes(
x = age, y = median_pay, color = sex))
# There is a way bigger gap for workers in their forties than people in their twenties
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers", degree == "Bachelor's")
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age)|>
summarize(n = n(),median_pay= median(pay) )
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x =age, y=median_pay, color = sex))+
geom_line()
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 39/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
______
# endfold
# fold: [Plot the age-specific medians]
age_work |>
______
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers") |>
filter(degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: the gap increases into the 40s
QUESTION 14 · Other responses · 40/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
print() |>
filter(
degree == "Bachelor's",
occupation == "Software developers"
) |>
print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's",
occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() + geom_line(aes(x = age, y = median_pay, color = sex)
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 41/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: the gap in the twenties is not that big, almost identical, but it starts to get wider in the 40s to the late 40s, then has a sharp increase near the 50s
QUESTION 14 · Other responses · 42/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(
occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
gg_line(aes(x=age, y=median_pay, color=sex)) +
labs(x = "Age", y = "Pay (in dollars)", color = "Gender")
# endfold
# Compare pay gaps in the two age groups.
# Your answer: pay gaps start to increase as you get older
QUESTION 14 · Other responses · 43/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(
x = age, y = median_pay, color = sex)
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap closes as age increases
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |> filter(education == "Bachelor's", occupation == "Software developers")
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |> summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
gg_plot() + geom_line(aes(x= age, y = median_pay), color = sex)
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 44/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names)|>
filter(
degree == "Bachelor's",
occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age)|>
summarize(n=n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot()+ geom_line(aes(x=age, y =median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:The gap increases as age increases
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names)|>
filter(
degree == "Bachelor's",
occupation=="Software developers")}>
print
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age)|>
summarize(n=n()),
median_pay=median(pay)
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot()+
geom_line(aes(x=age, y=median_pay), color=sex)
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 45/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names)|>
filter(degree == "Bachelor's", occupation == "Software developers") |>
print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot() +
geom_line(aes(
x = age, y = median_pay, color = sex
))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: the gap widens as age grows older. the gap is small for 20s, and large for 40s
QUESTION 14 · Other responses · 46/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names)|>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age)|>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex))+
geom_line()
# Compare pay gaps in the two age groups.
# Your answer: the gap increases for workers in their forties
QUESTION 14 · Other responses · 47/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x=age, y=median_pay, color=sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: for women it stays around the same for their 20s and 40s, for men, pay increases
QUESTION 14 · Other responses · 48/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
inner_join(occupation_names)|>
filter(degree=="Bachelor's", occupation=="Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex,age)|>
summarize(n=n(),median_pay=median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
# endfold
labs(x = "Age", y = "Median pay(unit: 1000$)",
color = "Sex")
# endfold
# Compare pay gaps in the two age groups.
# Your answer: as age is larger, the gap is also larger
QUESTION 14 · Other responses · 49/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation == "Software developers", degree == "Bachelor's") |>
print()
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x=age,y=median_pay,color=sex)) +
geom_line()
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
#As age increases, so does the gender pay gap
QUESTION 14 · Other responses · 50/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names)|>
filter(degree == "Bachelor's", occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age)|>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x = age, y = median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap is bigger in people's 40s than their 20s.
QUESTION 14 · Other responses · 51/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(occupation == "Software developers",
degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay),
.groups = "drop"
)
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay (USD)",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer: There definitely is a gap in pay between Males and Females. Males tend to have a greater median pay than females as the age increases
QUESTION 14 · Other responses · 52/64
Student responses
# fold: [Find software developers with a BA]
software_work <- acs |> left_join(occupation_names) |>
filter(degree == "Bachelor's",occupation == "Software developers")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |> summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() + geom_line(aes(x=age, y=median_pay, color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 53/64
Student responses
acs
# fold: [Find software developers with a BA]
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(occupation == "Software developers") |> filter(degree == "Bachelor's")
# endfold
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |> summarize(n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) + geom_line() +
labs(x = "Age", y = "Pay")
# endfold
# comment
# Compare pay gaps in the two age groups.
# Your answer: The pay gap is very simliar
# It differs a lot
QUESTION 14 · Other responses · 54/64
Student responses
acs %>%
left_join(occupation_names, by = "occupation_code") %>%
filter(occupation == "Software developers", degree == "Bachelor's") %>%
group_by(sex, age) %>%
summarize(
n = n(),
median_pay = median(pay, na.rm = TRUE)
) %>%
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay (USD)",
color = "Sex"
)
# Compare pay gaps in the two age groups.
# The pay gap looks smaller in workers' twenties and larger in their forties.
age_pay <- acs |>
inner_join(occupation_names, by = "occupation_code") |>
filter(
occupation == "Software developers",
degree == "Bachelor's"
) |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay)
)
age_pay |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay ($1,000s)",
color = "Sex"
)
# The pay gap is smaller for workers in their twenties and larger for workers in their forties.
QUESTION 14 · Other responses · 55/64
Student responses
answer: software_work <- acs |>
left_join(occupation_names, by = "occ1990") |>
filter(occupation == "Software Developers",
degree == "Bachelor's")
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(income),
.groups = "drop"
)
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay (US dollars)",
color = "Sex"
)
# The pay gap is usually small in workers' twenties but becomes much larger in their forties.
QUESTION 14 · Other responses · 56/64
Student responses
occupation_names |>
inner_join(acs, by = "occupation") |>
filter(occupation_name == "Software developers", degree == "Bachelor's") |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(income),
.groups = "drop"
) |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay (USD)",
color = "Sex"
)
# The gap appears smaller when workers are in their twenties compared to when they are in their forties, and the gap gradually gets wider as time goes on
software_pay <- acs %>%
left_join(occupation_names, by = "occupation") %>%
filter(occ_name == "Software developers", degree == "Bachelor's") %>%
group_by(sex, age) %>%
summarize(
n = n(),
median_pay = median(income),
.groups = "drop"
)
# The pay gap is usually smaller in workers' twenties and larger in their forties.
ggplot(software_pay, aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay (US dollars)",
color = "Sex"
)
QUESTION 14 · Other responses · 57/64
Student responses
software_work <- acs |>
inner_join(occupation_names, by = "occupation") |>
filter(occupation_name == "Software developers",
education == "Bachelor's degree")
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay), .groups = "drop")
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age", y = "Median pay ($)", color = "Sex")
# Compare pay gaps in the two age groups.
# Your answer: bigger gap in 40s
QUESTION 14 · Other responses · 58/64
Student responses
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(
occupation == "Software developers",
degree == "Bachelor's degree"
)
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(pay),
.groups = "drop"
)
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_point() +
geom_line() +
labs(
x = "Age",
y = "Median pay ($1,000s)",
color = "Sex"
)
# Compare pay gaps in the two age groups.
# Your answer:
# The gender pay gap is small among workers in their
# twenties but larger among workers in their forties.
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 59/64
Student responses
software_work <- acs |>
left_join(occupation_names, by = "occupation_code") |>
filter(occupation == "Software developers", degree == "Bachelor's")
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay), .groups = "drop")
age_work |>
ggplot(aes(age, median_pay, color = sex)) +
geom_line() +
labs(x = "Age (years)", y = "Median pay ($1,000s)", color = "Sex")
# Compare pay gaps in the two age groups.
# Your answer:
# In their twenties, men and women have similar median pay
# (about $112k each at ages 25-29). In their forties, the gap is much
# larger: about $159k for men vs. $122k for women, a gap of roughly $37k.
QUESTION 14 · Other responses · 60/64
Student responses
software_work <- acs |>
left_join(occupation_names) |>
filter(
education == "Bachelor's degree",
occupation == "Software developers") |>
print()
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay), .groups = "drop")
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age", y = "Median pay ($1,000s)", color = "Sex")
# Compare pay gaps in the two age groups.
# Your answer: In their twenties, the lines are close together and the gap is small.
# By their forties, the lines pull apart and men's median pay is clearly higher than women's.
QUESTION 14 · Other responses · 61/64
Student responses
software_work <- acs |>
left_join(occupation_names) |>
filter(
occupation == "Software developers",
education == "Bachelor's degree"
)
age_work <- software_work |>
group_by(sex, age) |>
summarize(
n = n(),
median_pay = median(earnings, na.rm = TRUE),
.groups = "drop"
)
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age (years)",
y = "Median annual pay ($)",
color = "Sex"
)
# Hypothesis: the pay gap is smaller in the twenties
# and larger in the forties.
software_work <- acs |>
left_join(occupation_names) |>
filter(
occupation == "Software developers",
education == "Bachelor's"
)
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize (n = n(),
median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
age_work |> ggplot()+
geom_line(aes(x=age, y = median_pay,
color = sex))
# endfold
# Compare pay gaps in the two age groups.
# Your answer:
QUESTION 14 · Other responses · 62/64
Student responses
software_work <- acs |>
left_join(occupation_names) |>
filter(degree == "Bachelor's",
occupation == "Software developers")
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay),
.groups = "drop")
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(x = "Age",
y = "Median pay (US dollars)",
color = "Sex")
# endfold
# fold: [Plot the age-specific medians]
age_work |>
ggplot() +
geom_line(aes(x = age, y = median_pay, color = sex()))
# endfold
# Compare pay gaps in the two age groups.
# Your answer: The gap looks smaller in workers’ twenties and larger in their forties.
software_work <- acs |>
left_join(occupation_names) |>
filter(occupation_name == "Software developers",
education == "Bachelor's degree")
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(),
median_pay = median(pay, na.rm = TRUE),
.groups = "drop")
age_work |>
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
geom_point() +
labs(x = "Age", y = "Median pay ($)", color = "Sex")
# The gender pay gap is smaller in workers' twenties and larger in their forties.
QUESTION 14 · Other responses · 64/64
Student responses
software_work <- acs |>
left_join(occupations, by = "occupation_code") |>
filter(degree == "Bachelor's", occupation_code == 1021)
# fold: [Summarize earnings by sex and age]
age_work <- software_work |>
group_by(sex, age) |>
summarize(n = n(), median_pay = median(pay))
# endfold
# fold: [Plot the age-specific medians]
ggplot(aes(x = age, y = median_pay, color = sex)) +
geom_line() +
labs(
x = "Age",
y = "Median pay ($1,000s)",
color = "Sex"
)
# endfold
# Compare pay gaps in the two age groups.
# Your answer:The pay gap between men and women is smaller in their twenties than in their forties, with men earning more than women in both age groups.
CLASS RECORD · QUESTION 15
Among software developers with bachelor's degrees, median earnings are similar for younger men and women, but farther apart for older workers. What could be driving this pattern? Suggest an explanation and describe what additional data you would use to investigate it.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 16
- Keep 40-hour workers aged 25-29 or 40-49. Label the two groups age_group using ifelse(). - Report n and median_pay for each sex and age_group. - Put Male and Female medians on the same row for each age_group and calculate gap in dollars as Male minus Female.
How would you describe these results to a student about to graduate? Use the earnings gaps in both age groups.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 18 · 1/3
How would you write one regression formula that fits both lines? What would its response, age variable, and indicator be?
75 anonymous responses
Unspecified or placeholder formula18Provides a noninformative or placeholder regression expression without specifying variables or structure.
Misformatted or incorrect formula usage11Provides a formula or function call that mixes arguments or uses incorrect syntax for lm, suggesting confusion about proper formula structure.
Specify interaction model formula11Gives an explicit regression formula using an interaction between age and a group indicator (sex) to fit separate lines for each group.
Model the difference between groups8Proposes modeling the difference in central tendency between groups (e.g., using difference in median pay) as part of the regression to fit both lines.
CLASS RECORD · QUESTION 18 · 2/3
Response themes for question 18
Additive model without interaction7Suggests a model including age and a group indicator as additive terms (no interaction), implying common slope but different intercepts.
Explicit variable choices for model7Specifies which variable is the response, a transformed or centered age predictor, and a binary indicator for sex (female = 1, male = 0).
Include multiple predictors7States a need to include more than one predictor (implicitly suggesting age and a group indicator) to capture both lines.
CLASS RECORD · QUESTION 18 · 3/3
Response themes for question 18
Use grouping or plotting command6Recommends splitting or faceting the data or using an indicator conceptually rather than specifying a regression formula (mentions commands like facet or using an indicator to separate lines).
QUESTION 18 · Unspecified or placeholder formula · 1/2
Student responses
?
. use interaction and indictaor
Add an indicator variable, for example 0 if woman, 1 if man.
by creatibg 2 slopes and 2 intecrcpets anfd create a true anf false for it, yuse an interactiion term and an indicator
create your regression line, then for each predictor, also include an indicator variable that adds/subtracts from that predictor if that idicator is 1
ggplot(aes(x = age, y = mean_pay, color = sex) + geom_line()
I would regress with sex and job occupuation of software develper,, to predict the payment
I would use software as a 0/1 variable, and work hours a numeric one, to fit a regression that reflects all of them
Include an indicator variable, and indicator term where one represents an offset between slopes, and one is the offset between intercepts of the two regressions.
QUESTION 18 · Unspecified or placeholder formula · 2/2
Student responses
interaction
lm(~)
model difference between group with indicator
pay
the same as simple linear regression
Use an indicator variable to show whether age is in the right age group or not. and then use that if else statement to differentiate between the two age groups
Use the *. The indicator is gender, median pay is the response, and age is what is multiplied
we would use the code lm, and its age variable would be in groups, the response in a decreasing line, and indicator by the differences in median pay.
y = a + bx + cI
QUESTION 18 · Misformatted or incorrect formula usage · 1/2
Student responses
include 2 indicator variables
lm(median_pay ~ age sex, software_developers)
response would be the yearly pay, age would be how many years they worked
use indicator variables to have different intercepts and slopes for men and women.
we can use indicator variable to indicate the slope and intercept changes
we could regress pay on age_group for each gender
We could use lm to make a linear model or geom_line or abline
We would include the interaction conefficient
We would use an indicator variable that is set to 0 or 1 depending on which line we are thinking about and then work from there
QUESTION 18 · Misformatted or incorrect formula usage · 2/2
Student responses
You would need to use an indicator that gives a value of 0 or 1 depending on if someone is classified as male or female. In this we do an almost interaction between two predictors that we want to use and then can use that to get different intercepts and slopes for the relevant group we care about.
You would use indicator variables with the second regression variable being an additional slope on the line but multiplied by the indicator variable.
QUESTION 18 · Specify interaction model formula · 1/2
Fit lm(pay ~ age0 * female, data = age_data). The response is pay, the age variable is age0 (age − 25), and the indicator is female
I would fit pay ~ age * female. The response is pay (mean annual pay), the age variable is age, the indicator is female (1 for women, 0 for men), and the interaction is age:female. That interaction captures how the women's slope differs from the men's slope — I expect it to be negative since the gap widened with age in the medians.
lm(pay ~ age * gender, data = software_bachelors)
lm(pay ~ age * sex, data = software_bachelors)
pay ~ age * woman response is pay, age variable is age, indicator is women.
pay=β0+β1age0+β2female+β3age0female+ϵ.
Regress pay on age, a female indicator (1 for women, 0 for men), and age times female, so the response is pay, the age variable is age, the indicator is female, and the interaction coefficient shows how much women’s slope differs from men’s.
QUESTION 18 · Specify interaction model formula · 2/2
Student responses
The response would be pay, the age variable would be age, and the indicator would be sex, with an interaction like pay ~ age * sex so men and women can have different slopes.
Use a multiple regression with an indicator to show both lines
use one linear model with an interaction between age and gender, response is pay and age variable is just age
QUESTION 18 · Model the difference between groups · 1/1
Student responses
\hat{pay} = \beta_1 * age + \beta_2 * sex + \beta_3 * sex * age Where sex is an indicator variable.
Indicator variables we can assign them values 0 or 1. If we want to see the effect of women or men, we can change the indicator variable to 1. If not, we set it to 0 so we can only look at the effect of the other variable.
no idea
not sure
pay = B0+B1(age)+B2(sex)+B3(age*sex)
response variable would be pay and indicator variable would be sex.
response would be pay, age variable would be age, and indicator variable would be sex which would be 1 or 0 to fit a line for both sexes.
You use an interaction coefficient with age, so sex and age are the predictors
QUESTION 18 · Additive model without interaction · 1/1
Student responses
A binary variable for age group for the impact on intercept, then a binary indicator for age group that interacts with year for the impact on the slope of pay.
Im not sure honestly
Indicator vairable for weather it is a female or male. The variable itself would be median_pay and graph in by age
lm(median_pay ~ sex + age , data = software_bachelors
lm(pay ~ age + female, software_bachelors)
lm(pay ~ age + sex) sex would be the indicator variable
response is pay, age is age, indicator is sex.
QUESTION 18 · Explicit variable choices for model · 1/1
Student responses
I would use pay as the response variable, age minus 25 as the predictor, and female as an indicator variable
Im not sure
lm(salary ~ age * woman, data = software_bachelors)
The regression formula would include an x variable and a y variable so both could be included on the line.
The response is annual earnings, and the age variable is age in years. With women as the reference group, the indicator is 1 for men and 0 for women.
use annual pay as the response variable, age minus 25 as the age variable, and a female indicator equal to 1 for women and 0 for men
you would have to separate the slopes and intercepts and use and indicator variable to label women as 1
QUESTION 18 · Include multiple predictors · 1/1
Student responses
Call a linear regression function on pay compared to year and sex, with both as predictors
I would have to take in multiple predictors
I would select the degree, age, and pay and regress them
I would write a regression on age predicting pay with a indicator variable on sex to account for both regression lines in one linear model
i would write one regression formula by including multiple predictors or use a placeholder formula
using the mean of both
would have to do multiple regression. not sure on the rest
QUESTION 18 · Use grouping or plotting command · 1/1
Student responses
To fit both lines you could use an indicator variable
use the lm function
We can use an indicator variable for sex
you use a command to split into two groups
You use a command to split into two groups and then plot individual regression lines from both groups.
you use a command to split into two groups like facet
CLASS RECORD · QUESTION 19
- Fit pay with separate intercepts and age slopes for men and women. - Display the coefficients and identify the coefficient measuring the slope difference.
74 anonymous responses
Other responses74
QUESTION 19 · Other responses · 1/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age * female,
data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age * female,
data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age * female, data = age_data)
coef(age_work_model)
summary(# fold: [Allow each group its own intercept and slope]
age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age * gender, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age * sex, data = age_data)
coef(age_work_model)
# endfold
QUESTION 19 · Other responses · 2/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age*0, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age*sex, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female , data = age_data)
coef(age_work_model)
# endfold
summary(age_work_model)
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female , data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female,
data = age_data)
coef(age_work_model)
# endfold
summary(age_work_model)
QUESTION 19 · Other responses · 3/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female,
data = age_data)
summary(age_work_model)
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female,
data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female,
data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female,
data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female,
data = age_data)
summary (age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
age_work_model |> summary()
# endfold
QUESTION 19 · Other responses · 4/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
QUESTION 19 · Other responses · 5/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
QUESTION 19 · Other responses · 6/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
# endfold
summary(age_work_model)
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
QUESTION 19 · Other responses · 7/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
#coefficient measuring slope difference is
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
QUESTION 19 · Other responses · 8/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 *female,
data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 + female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0 + female, data = age_data)
summary(age_work_model)
# endfold
QUESTION 19 · Other responses · 9/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0*female, data = age_data)
coef(age_work_model)
# endfold
QUESTION 19 · Other responses · 10/11
Student responses
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ age0+female+age0*female, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ sex * age, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~ sex, data = age_data)
coef(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~age0 * female, data = age_data)
summary(age_work_model)
# endfold
# fold: [Allow each group its own intercept and slope]
age_work_model <- lm(pay ~sex * age, data = age_data)
summary(age_work_model)
# endfold
fit <- lm(pay ~ age0 * female, data = age_data)
summary(fit)
pay_model <- lm(pay ~ age * sex, data = software_bachelors)
coef(pay_model)
CLASS RECORD · QUESTION 20
An analyst says: "The coefficient on female is nearly zero, so this model shows no earnings gap." Do you agree? Use predicted earnings at ages 25 and 45 in your answer.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 21
Which row tests equal slopes? What does its estimate tell us about the age pattern? What does its p-value tell us?
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 22 · 1/2
Do you expect a similar dollar gap among low earners and high earners? What would you look at beyond the median to check your prediction?
78 anonymous responses
High earners larger dollar gap49Student predicts high earners will exhibit a larger dollar wage gap (states high earners have higher gap).
Low earners smaller gap9Student expects a smaller gap among lower-income people compared to higher-income people.
Ambiguous/unspecified larger gap5Student asserts a larger gap but does not specify whether it applies to low or high earners or provide checks beyond the median.
Expect similar gap / same data4Student expects the dollar gap to be similar across earners or unchanged because the underlying data are the same.
CLASS RECORD · QUESTION 22 · 2/2
Response themes for question 22
Check percentiles/means beyond median3Student emphasizes comparing percentiles, quartiles, means, ratios, and the full distribution (grouping by wage levels) in addition to the median to assess differences between low and high earners.
High earners smaller gap3Student predicts the dollar gap will be smaller among high earners.
Unsure / lack of prediction3Student expresses uncertainty and does not commit to a prediction or specific checks beyond the median.
Other responses2
QUESTION 22 · High earners larger dollar gap · 1/7
Student responses
Based on our knowledge that the pay gap gets larger the longer you work, I would expect the gap to be smaller around low earners and larger around high earners.
bigger gaps
bigger. we could look at 75th percentile for high earners and 25th percentile for low earners
For higher earners, I expect there to be a higher wage gap as mostly men are likely in the top positions to be making that much money. I believe I would also begin to look at the mean now that outliers are less prevalent when we group the wages together.
For higher earns, I expect there to be.a higher wage gap as mostly top positions get paid a lot more money.
High earners will have a greater dollarr gap
high earners will have a higher wage gap
Higher gap among high earners, since the absolute amounts of pay is higher.
I expect a bigger difference among high earners
QUESTION 22 · High earners larger dollar gap · 2/7
Student responses
I expect a bigger gap among high earners
I expect a different dollar gap among low earners and high earners. Beyond the median, I would also look at percentiles and mean.
I expect a higher gap among high learners because people can earn really a little without too much difference
I expect a higher gap for high earners because theres more males that earn higher wages. I would look at the standard deviation and range of earnings to check my answer.
I expect a higher gap for high earners, I would look at the standard deviation to see the variance
i expect a higher gap with the high earners, because even if the ratio is the same, the dollar amount changes
I expect a higher wage gap for higher earners
I expect a larger gap among high earners because they are able to pay more, making the gap bigger.
I expect higher gap among high earners. I would look at mean and quantiles other than median to check this
QUESTION 22 · High earners larger dollar gap · 3/7
Student responses
I expect that gap to be bigger between high earners.
I expect the dollar gap to be larger among high earners.
I expect the gap to be larger in higher earners. Beyond the median, we can look at the people with the highest and lowest salaries.
I expect there to be a higher dollar gap for high earners, because there is much more room to earn more than there is to earn less (assuming at minimum a living wage). The q1 and q3 values could show this.
I guess more on high earners, ratio
I think at the lower end of the distribution the gap will be small because there isnt much room ro decrease past a jobs base starting rate, while the higher end of the distribution the gap will be larger
i think bigger gapa between high earners
I think high earners would have a higher pay gap and among low earners the gap tends to be smaller. Beyond the median, I would look at the types of jobs and the degrees each job requires within each earning category.
QUESTION 22 · High earners larger dollar gap · 4/7
Student responses
I think people make less money has the less earning gap, there is no that much thing to differentiate them, but i think the as the payment increases, the payment gap increases
I think that there will be a higher wage gap between those that make more money and it will be a lower gape between those that make less. This is largely due to the fact that high earners are likely later in their career and we saw that the top of our data was male dominated in terms of salary. We should also check to see what percentage is male vs female in these categories
I think that there will be a lower wage gap for lower earners and a higher wage gap for higher earners. I would make a graph separated by high and low with lines for men and women and pay.
I think the gap is smaller for low earners and way bugger for high earners. I would try to graph and look at differnce between those two groups
QUESTION 22 · High earners larger dollar gap · 5/7
Student responses
I think the gap would change based on which group we are observing. for example for low earners, i think the gap would be smaller, but for high earners the pay can fluctuate a bit more so we might want to use percentiles to observe that prediction
I think there is going to be a larger wage gap because c suite is male dominated
I would expect a gap amongst high earners. Women were historically disadvantaged from entering positions of authority, which tend to be better paid. I would look at the breakdown of professions for this.
i would expect a general similar gap maybe a slightly higher gap in high earners, i would look at the jobs catergorized by high and low pay
I would expect a larger dollar gap among high earners but a larger percentage gap about low earners. To check my prediction, I would make residuals
i would expect bigger wage gap for high earning. you would have to group by wage level and compare means/medians of groups
i would expect higher earners to have higher gaps since more men are in high earning jobs on average. to check i would group by salary bands
QUESTION 22 · High earners larger dollar gap · 6/7
Student responses
I would expect the gap to be higher in the high-earning careers.
I would expect the pay gap to be larger among high earners, and I would compare different percentiles of men’s and women’s pay, not just the median.
I would expect there to be a high gap between high earners and low earners
i would expect there to be a higher wage gap among high earners. I would look at the ratio
I would not necessarily expect the same dollar gap for low earners and high earners. I would expect the gap could be larger among higher earners. I would look at other parts of the pay distribution, not just the median — especially the 25th percentile and 75th percentile (and possibly the 90th percentile). Comparing these percentiles by sex would show whether the gap changes between lower- and higher-paid workers.
I would predict a larger dollar gap among high earners, I would compare mens and wormenr enaring at 10 50 and 090 percentile
I’d expect a larger dollar gap among high earners, because even the same percentage gap represents more dollars at higher salaries.
QUESTION 22 · High earners larger dollar gap · 7/7
Student responses
no i would not expect a similar dollar gap among low and high earners. incomes tend to fan out, so dollar gap usually widens significantly among high earners
No, I would expect a larger dollar gap among high earners and a smaller one among low earners. Pay is more spread out at the top, so even a similar percentage gap becomes more dollars. I would look beyond the median at quartiles/percentiles and the whole distribution for men and women.
the higher the earners the bigger the gap
there will probably be a higher wage gap as high earners are generally older and we've already seen that the gap increases with age.
top 75th percentile vs first 25th percentile. The gap will be larger among top earners.
QUESTION 22 · Low earners smaller gap · 1/1
Student responses
I assume the gap will be smaller on lower income people as oppossed to higher income people
I expect a lower dollar gap among low income earners. This is why I would check the ratio of earnings instead of the raw dollar amount.
I would expect the gap among low earners to be closer
low earners should have a lower dollar gap.
Low earners will have lower gap while high earners will have higher gap. Yes we should look beyond median
no, I think the dollar gap among low earners is smaller. I would separate high earners from low earners and check the average difference
The gap should be lower for low earners because the pay limits the variance. I would check the IQR or some form of variance
the gap should be smaller for lower earners because they haven't been promoted or stratified in any way to justify a gap. i would look at different percentiles in earners
The gap should be smaller for lower wage workers group compared to higher wage works. I would make two regression lines showing differences in the two different income groups and then analyze from there
QUESTION 22 · Ambiguous/unspecified larger gap · 1/1
Student responses
I would expect a different gap for low and high earners. High earners are exceptions and likely do not follow a formulaic salary path while low wage earners do
I would look at p-value and coefficients
No I think in high income workers will not have this kind of differicen
the gap should be smaller
如果高分位数的差距更大 那就说明收入越高,性别工资差距可能越明显。
QUESTION 22 · Expect similar gap / same data · 1/1
Student responses
i expect a similar gap
I think there will be a similar gap as there was for the median because it's the same data.
similar
The gap would be about the same, and we would look at the mean and standard deviation as well.
QUESTION 22 · Check percentiles/means beyond median · 1/1
Student responses
No. I would filter the pay into two groups, low and high, and compare median pay differences
Yes
yes,
QUESTION 22 · High earners smaller gap · 1/1
Student responses
I expect the gap among high earners to be smaller
The gap is not higher amongts the largfest earners. I look at variance.
The gap should be bigger for high earners because they already have a very strong skill set, so they already get paid a lot so its a bigger dollar amount
QUESTION 22 · Unsure / lack of prediction · 1/1
Student responses
expect smaller gap among low earners than high earners. check ratios within group
no I do not expect similar dollar gap
unsure
CLASS RECORD · QUESTION 23
- Calculate p10, p50, and p90 of pay separately for men and women. - Reshape the three percentile columns into rows named percentile and pay. - Plot earnings by percentile, distinguishing men and women. Label the pay units. - Add a code comment stating where the dollar gap is largest, using values from your table.
70 anonymous responses
Other responses70
QUESTION 23 · Other responses · 1/68
Student responses
# Find p10, p50, and p90 for each sex
pay_percentiles <- software_bachelors |>
group_by(sex) |>
summarize(p10 = quantile(pay, 0.10),
p50 = quantile(pay, 0.50),
p90 = quantile(pay, 0.90))
# Turn the percentile columns into rows
pay_long <- pay_percentiles |>
pivot_longer(cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay")
# Plot the earnings at each percentile
pay_long |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(x = "Percentile", y = "Pay ($1,000s)", color = "Sex")
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90
QUESTION 23 · Other responses · 2/68
Student responses
# fold: [Calculate p10, p50, and p90 of pay separately for men and women]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, fill = sex)) +
geom_col(position = "dodge") +
labs(
title = "Earnings by Percentile for Men and Women",
x = "Percentile",
y = "Annual Earnings ($)",
fill = "Gender"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
# The dollar gap is largest at the 90th percentile (p90).
# For example, if p90 is $120,000 for men and $85,000 for women (difference = $35,000),
# compared to smaller absolute differences at p50 and p10.
QUESTION 23 · Other responses · 3/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
pay_pct <- your_data %>%
group_by(gender) %>%
summarise(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
) %>%
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
pay_pct
ggplot(pay_pct, aes(x = percentile, y = pay, color = gender, group = gender)) +
geom_point(size = 2) +
geom_line() +
labs(x = "Percentile", y = "Pay (dollars)", color = "Gender")
# Where is the dollar gap largest? Use values from your table.
# Your answer:its largest when the pay is hgiher, gap is largest in 0.9 percentile
QUESTION 23 · Other responses · 4/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile"
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geomplot(aes(x=percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:90th percentile has the biggest gap
QUESTION 23 · Other responses · 5/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
______
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
______
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
______
# endfold
pay_summary <- software_bachelors |>
group_by(sex) |>
summarise(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
)
pay_summary
pay_percentiles <- pay_summary |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
pay_percentiles
pay_percentiles |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_point() +
geom_line() +
labs(
x = "Pay percentile",
y = "Annual pay ($)",
color = "Sex"
)
pay_percentiles |>
group_by(percentile) |>
summarise(gap = max(pay) - min(pay)) |>
arrange(desc(gap))
# Where is the dollar gap largest? Use values from your table.
# Your answer:# The largest dollar gap is at the percentile with the highest gap
# in the table above.
QUESTION 23 · Other responses · 6/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
______
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to="percenntile"
values="pay"
)|>print
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
______
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by( sex) |>
summarize(
p10 = quantile(pay,0.1), p50 = quantile(pay, 0.5), p90 = quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90, names_to = "percentile", values_to = "pay"
)
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
# largest at 90th
QUESTION 23 · Other responses · 7/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
summarize(
q10 = quantile(pay,0.1),
q50 = quantile(pay,0.5),
q90 = quantile(pay,0.9)
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
pivot_longer(p10:p90, values_from = "pay",names_from = "percentile")
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 8/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
mutate(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9),
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = percentile,
values_to = pay
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 9/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarise(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex)) +
geom_point() +
labs(
x = "Percentile",
y = "Annual Pay",
color = "Sex"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: At p90.
QUESTION 23 · Other responses · 10/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_point(size = 2) +
geom_line() +
labs(x = "Percentile", y = "Pay (dollars)")
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:yes
QUESTION 23 · Other responses · 11/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 12/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot()+ geom_point(aes(x = percentile,
y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:p90
QUESTION 23 · Other responses · 13/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
______
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 14/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: Largest at 90 percentile
QUESTION 23 · Other responses · 15/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: The dollar gap is largest at the p90 percentile.
QUESTION 23 · Other responses · 16/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: the 90th percentile has the biggest gap
QUESTION 23 · Other responses · 17/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9),
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90 is the largest
QUESTION 23 · Other responses · 18/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90,
names_to = "percentile",
values_from = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes (x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 19/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 20/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .10),
p50 = quantile(pay, .50),
p90 = quantile(pay, .90)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90, names_to = "percentile", values_to = "pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90th percentile
QUESTION 23 · Other responses · 21/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 22/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x= percentile, y = pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 23/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90, names_to = "percentile", values_to = "pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex)) + geom_point()
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: It is the largest at the 90th percentile
QUESTION 23 · Other responses · 24/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x=percentile, y=pay, color=sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90 percentile has the biggest gap
QUESTION 23 · Other responses · 25/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile ,
y= pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: the dollar gap is the largest for 90th percentile of 50
QUESTION 23 · Other responses · 26/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(x = "Percentile", y = "Pay ($)")
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: The dollar gap is the largest at percentile 90%
QUESTION 23 · Other responses · 27/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10),
p50 = quantile(pay, 0.50),
p90 = quantile(pay, 0.90)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(
x = "Percentile",
y = "Pay ($)",
color = "Sex"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: The dollar gap is largest at p90 because
QUESTION 23 · Other responses · 28/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10),
p50 = quantile(pay, 0.50),
p90 = quantile(pay, 0.90),
.groups = "drop"
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(
x = "Percentile",
y = "Pay (dollars)",
color = "Sex"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: The dollar gap is largest at the percentile where the difference between the male and female pay values in the table is greatest.
QUESTION 23 · Other responses · 29/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10),
p50 = quantile(pay, 0.50),
p90 = quantile(pay, 0.90),
.groups = "drop"
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(x = "Percentile", y = "Pay ($)", color = "Sex")
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 30/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantitle(pay, .1),
p50 = quantitle(pay, .5),
p90 = quantitle(pay, .9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
vlaue_from = p10:p90,
names_from = sex
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 31/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
q10 = quantile(pay, .1),
q50 = quantile(pay, .5),
q90 = quantile(pay, .9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = q10:q90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() +
geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: the gap is largest in the 90th percentile
QUESTION 23 · Other responses · 32/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90,
names_to = "percentile",
values_to = "pay") |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x= percentile, y=pay, color= sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90th percentile has the biggest gap
QUESTION 23 · Other responses · 33/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x= percentile, y = pay, color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90th percentile has the biggest gap
QUESTION 23 · Other responses · 34/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9))|> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90,
names_to = "percentile",
values_to = "pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:p90
QUESTION 23 · Other responses · 35/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90th percentile has the biggest gap, going from 203 to 254
QUESTION 23 · Other responses · 36/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarise(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: the dollar gap is the largest in the 90% percentile
QUESTION 23 · Other responses · 37/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .3),
p90 = quantile(pay, .9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() +
geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 38/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 39/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to= "percentile"
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: 90th percentile has largest gap
QUESTION 23 · Other responses · 40/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
) |> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() +
geom_point(aes(
x = percentile, y =pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 41/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9),
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer (
p10:p90,
names_to = "percentile",
values_to = "pay"
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color = sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 42/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10, na.rm=True),
p50 = quantile(pay, 0.50, na.rm=True),
p90 = quantile(pay, 0.90, na.rm=True)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile), y = pay, color = sex)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 43/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
q10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile,
y = pay,
color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 44/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
q10 = quantile(pay, 0.1),
q50 = quantile(pay, 0.5),
q90 = quantile(pay, 0.9)
) |>print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
q10:q90
) |> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() +geom_point(aes(
x = percentile, y = pay, color = sex)
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 45/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90, names_to = "percentile", values_to = "pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold)
# Where is the dollar gap largest? Use values from your table.
# Your answer:90th percentile has the largest at about 50k per year.
QUESTION 23 · Other responses · 46/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .10),
p50 = quantile(pay, .50),
p90 = quantile(pay, .90))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x=percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 47/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(
p10 = quantile(pay, .1),
p50 = quantile (pay, .5),
p90 = quantile (pay, .9)
)|> print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
values_to = "pay",
names_to = "percentile"
)|> print()
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(
x = percentile, y = pay, color =sex
))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90 is the largest
QUESTION 23 · Other responses · 48/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(q10 = quantile(pay, .1),
q50 = quantile(pay, .5),
q90 = quantile(pay, .9))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(values_from = p10:p90, names_from = sex)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
______
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 49/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(q10 = quantile(pay, .1),
q50 = quantile(pay, .5),
q90 = quantile(pay, .9)
)
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(q10:q90, values_from = "percentile",
names_from = "pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex))+
geom_point()
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 50/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(q10 = quantile(pay, 0.1), q50 = quantile(pay, 0.5), q90 = quantile(pay, 0.9))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(cols= c(q10, q50, q90), names_to="percentile", values_to="pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex,)) + geom_point()
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: q90
QUESTION 23 · Other responses · 51/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarise(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: At p90
QUESTION 23 · Other responses · 52/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(q10 = quantile(pay, 0.10),
q50 = quantile(pay, 0.50),
q90 = quantile(pay, 0.90))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
______
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 53/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot()+geom_point(aes(x=percentile, y=pay, color=sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 54/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, .1), p50 = quantile(pay, .5), p90 = quantile(pay, .9))
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90, values_to = "pay", names_to = "percentile")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90 is large
QUESTION 23 · Other responses · 55/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9))
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(names_to = "percentile", values_to = "pay")
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x=percentile, y = pay, color = sex)) +
geom_line()
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 56/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |>
group_by(sex)|>
summarize(
p10=quantile(pay, 0.1),
p50=quantile(pay, 0.5),
p90=quantile(pay, 0.9)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(p10:p90,names_to="percentile",values_to="pay")
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot()+
geom_line(aes(x=percentile,y=pay,color=sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 57/68
Student responses
# fold: [Find p10, p50, and p90 for each sex]
percentiles_work <- acs |> group_by(sex) |> summarize(p10 = quantile(pay, 0.1), p50 = quantile(pay, 0.5), p90 = quantile(pay, 0.9))
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |> pivot_longer(values_from = p10:p90)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |> ggplot() + geom_point(aes(x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
QUESTION 23 · Other responses · 58/68
Student responses
pay_percentiles <- wages %>%
group_by(sex) %>%
summarize(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
) %>%
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
pay_percentiles
# Replace the numbers below with the values from your table.
# The dollar gap is largest at p90 because men's pay minus women's pay is biggest there.
ggplot(pay_percentiles, aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_point(size = 2) +
geom_line() +
labs(
x = "Percentile",
y = "Pay ($)",
color = "Sex"
)
QUESTION 23 · Other responses · 59/68
Student responses
percentile_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
) |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
percentile_work |>
ggplot(aes(x = percentile, y = pay,
color = sex)) +
geom_point(size = 3) +
labs(
x = "Earnings percentile",
y = "Pay ($1,000s)",
color = "Sex"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer:
# The dollar gap is largest at the 90th percentile.
percentiles <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10),
p50 = quantile(pay, 0.50),
p90 = quantile(pay, 0.90)
) |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
percentiles |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_point() +
geom_line() +
labs(
x = "Percentile",
y = "Pay ($1,000s)",
color = "Sex"
)
# The dollar gap is largest at the 90th percentile.
QUESTION 23 · Other responses · 60/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(earnings, 0.10, na.rm = TRUE),
p50 = quantile(earnings, 0.50, na.rm = TRUE),
p90 = quantile(earnings, 0.90, na.rm = TRUE),
.groups = "drop"
)
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(x = "Earnings percentile", y = "Annual earnings ($)",
color = "Sex")
largest_gap <- percentiles_long_work |>
pivot_wider(names_from = sex, values_from = pay) |>
mutate(gap = Male - Female) |>
slice_max(gap, n = 1, with_ties = FALSE)
cat(sprintf(
"# Largest gap at %s: men $%.0f, women $%.0f; gap $%.0f.\n",
largest_gap$percentile, largest_gap$Male,
largest_gap$Female, largest_gap$gap
))
QUESTION 23 · Other responses · 61/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, .1),
p50 = quantile(pay, .5),
p90 = quantile(pay, .9)
)
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot() + geom_point(aes( x = percentile, y = pay, color = sex))
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: p90
QUESTION 23 · Other responses · 62/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1, na.rm = TRUE),
p50 = quantile(pay, 0.5, na.rm = TRUE),
p90 = quantile(pay, 0.9, na.rm = TRUE)
)
# Turn the percentile columns into rows
percentiles_long_work <- percentiles_work |>
pivot_longer(
p10:p90,
names_to = "percentile",
values_to = "pay"
)
# Plot the earnings at each percentile
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_point() +
geom_line() +
labs(y = "Pay (dollars)", x = "Percentile")
QUESTION 23 · Other responses · 63/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1, na.rm = TRUE),
p50 = quantile(pay, 0.5, na.rm = TRUE),
p90 = quantile(pay, 0.9, na.rm = TRUE),
.groups = "drop"
)
percentiles_long_work <- percentiles_work |>
tidyr::pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex)) +
geom_point(size = 3) +
labs(
x = "Earnings percentile",
y = "Annual earnings (thousands of dollars)",
color = "Sex"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# the largest gap is 50 men earn 250 thousand and women earn 200 thousand
QUESTION 23 · Other responses · 64/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9)
) |>
print()
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
# fold: [Plot the earnings at each percentile]
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(y = "Pay (dollars)", x = "Percentile")
# endfold
# Where is the dollar gap largest? Use values from your table.
# Compare men and women at p10, p50, and p90 in percentiles_work; the largest difference is the largest dollar gap.
QUESTION 23 · Other responses · 65/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.1),
p50 = quantile(pay, 0.5),
p90 = quantile(pay, 0.9),
.groups = "drop"
)
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = p10:p90,
names_to = "percentile",
values_to = "pay"
)
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex)) +
geom_point() +
labs(
x = "Earnings percentile",
y = "Pay ($1,000s)",
color = "Sex"
)
# Your answer:
# The dollar gap is largest at the 90th percentile.
QUESTION 23 · Other responses · 66/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, 0.10, na.rm = TRUE),
p50 = quantile(pay, 0.50, na.rm = TRUE),
p90 = quantile(pay, 0.90, na.rm = TRUE)
)
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_point(size = 2) +
geom_line() +
labs(x = "Percentile", y = "Pay (dollars)")
# Where is the dollar gap largest? Use values from your table.
# Your answer: The dollar gap is largest at p90.
QUESTION 23 · Other responses · 67/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(
p10 = quantile(pay, probs = 0.10, na.rm = TRUE),
p50 = quantile(pay, probs = 0.50, na.rm = TRUE),
p90 = quantile(pay, probs = 0.90, na.rm = TRUE)
)
# endfold
# fold: [Turn the percentile columns into rows]
percentiles_long_work <- percentiles_work |>
pivot_longer(
cols = c(p10, p50, p90),
names_to = "percentile",
values_to = "pay"
)
# endfold
percentiles_long_work |>
ggplot(aes(x = percentile, y = pay, color = sex, group = sex)) +
geom_line() +
geom_point() +
labs(
x = "Percentile",
y = "Pay ($)",
color = "Sex"
)
# endfold
# Where is the dollar gap largest? Use values from your table.
# Your answer: It's biggest for p90
QUESTION 23 · Other responses · 68/68
Student responses
percentiles_work <- acs |>
group_by(sex) |>
summarize(p10 = quantile(pay, probs = 0.1),
p50 = quantile(pay, probs = 0.5),
p90 = quantile(pay, probs = 0.9),
.groups = "drop")
percentiles_long_work <- percentiles_work |>
pivot_longer(c(p10, p50, p90), names_to = "percentile", values_to = "pay")
percentiles_long_work |>
ggplot(aes(percentile, pay, color = sex)) +
geom_point() +
labs(x = "Percentile", y = "Annual pay ($1,000s)", color = "Sex")
# Where is the dollar gap largest? Use values from your table.
# Your answer
# The gap is largest at the 90th percentile, about $51k
# (vs. about $20k at the median and $5k at the 10th percentile).
CLASS RECORD · QUESTION 24
A report describes the earnings gap as $20,000. Write a more informative one-sentence summary using this plot.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 25
We also know each worker's degree, usual hours, and whether they work in the public or private sector. Which would you investigate first, and what would you calculate or plot?
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 26
- Calculate the conditional degree distribution within each sex. - Report the fraction with master's degrees for women and for men.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 27
Use the full `acs` table to make age plots separately for bachelor's and master's graduates. What needs to change in the grouping and plot?
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 28
- Calculate hourly_pay from pay, hours, and weeks, with pay converted to dollars. - Report median weekly hours and hourly earnings by sex.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 29
Do these results support working hours as the main explanation for the annual earnings gap? Cite a number in your answer.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 30
What would you change in the overall summary to make this table? What plot would you use to show the four medians?
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 31
Calculate median pay for men and women within each sector. Make and submit a plot showing all four medians. Which sector has the larger dollar gap?
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 32
Suggest one further analysis that would help explain the smaller public-sector gap. Use a variable we have and describe the table or plot you would make.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 33
- Calculate median_pay for each occupation and sex. - Put Male and Female median_pay on the same row for each occupation. - Calculate gap as Male minus Female and sort from largest to smallest.
0 anonymous responses
No responses were submitted.
CLASS RECORD · QUESTION 34
Write one sentence about the historical trend, one about the same-job age pattern, and one about the earnings distribution. Include a number and suggest one next investigation.