PS 812: Problem Set 4

Author

YOUR NAME

Published

October 20, 2026

This problem set is due at 11:59pm on Tuesday, November 3. Please submit your solutions via Gradescope. Upload both a rendered .html file saved as “Yourlastname_Yourfirstinitial_pset4.html” and the corresponding Quarto file saved as “Yourlastname_Yourfirstinitial_pset4.qmd”. We recommend editing the provided .qmd file directly and writing your answers and code in line with the questions. We should be able to run your code without error messages. You are strongly encouraged to discuss the problems with other students, but each student must write up their own answers and code. In order to receive credit, homework submissions must be substantially started and all work must be shown.

Problem 1

A large literature in political science focuses on divides in political attitudes by college education. Non-college voters have moved towards supporting right-wing parties, particularly populist right-wing parties, in many democracies. Gidron and Hall (2017) argue that this trend is rooted partly in growing status anxiety among men without a college education. To document this pattern, they examine data from the International Social Survey Programme (ISSP) (ISSP Research Group 2022) - a periodic survey of residents of many different countries over time. They specifically look at responses to the following question which measures subjective social status:

In our society, there are groups which tend to be towards the top and groups which tend to be towards the bottom. Below is a scale that runs from the top to the bottom. Where would you put yourself on this scale?

Respondents answer on a scale that runs from 1 (bottom) to 10 (top).

The file issp2019_status_counts.csv in the data folder covers respondents aged 30 to 65 in ten countries who answered this status question. The file does not contain the raw per-respondent data. Instead, it is stored in a compressed form that is common for large surveys and census tables. Each row describes a unique combination of the variables and provides a count of the number of respondents in the survey who fall into that cell. The columns are:

  • country
  • sex: "Male" or "Female"
  • degree: highest completed education level, 0 no formal education, 1 primary, 2 lower secondary, 3 upper secondary, 4 post-secondary non-tertiary, 5 lower-level tertiary (including bachelor’s degrees), 6 upper-level tertiary (master’s or doctorate); NA if missing
  • topbot: the answer on the 1 to 10 ladder
  • n: the number of respondents in that cell

The ISSP provides no survey weights for these countries. We are assuming that we have simple random samples from the target population. In other words, assume the pairs \((Y_i, G_i)\) are independently and identically distributed.

For the purposes of this problem set, a respondent has tertiary education if degree is 5 or 6 (bachelor’s or post-graduate). Let \(Y_i \in \{1, \dots, 10\}\) denote respondent \(i\)’s answer to the social status question and \(G_i \in \{0, 1\}\) whether they completed tertiary education. Let \(n_1\) and \(n_0\) be the number of respondents with and without tertiary education.

Part A

First, we need to convert the table into a dataset with one row per respondent. The uncount() function from the tidyr package will accomplish this - be sure to read the documentation. How many rows does the file have? How many total respondents does it describe?

Part B

For now, we will focus on Switzerland - create a new dataframe that contains only Swiss men with non-missing degree data and create the tertiary indicator. Make a bar plot showing, for each group, the share of respondents at each rung of the ladder (the two groups should be easy to compare). Briefly describe the two distributions.

Part C

Our first estimand is the difference in means

\[\tau = E[Y_i \mid G_i = 1] - E[Y_i \mid G_i = 0]\]

Write down the plug-in estimator \(\hat{\tau}\) and compute it for Switzerland.

Part D

Derive \(Var(\hat{\tau})\) (conditional on \(n_1\) and \(n_0\)) in terms of the two conditional variances \(\sigma_1^2 = Var(Y_i \mid G_i = 1)\) and \(\sigma_0^2 = Var(Y_i \mid G_i = 0)\). Propose an estimator of the standard error, compute it, and report a 95% asymptotically normal confidence interval for \(\tau\). Interpret your results. What do we conclude about the relationship between education and subjective social status?

Part E

Now estimate the difference-in-means between tertiary and non-tertiary for each of the countries in the dataset for both men and women, again dropping respondents with missing degree (hint: this will be very easy if you wrote your code from Parts B-D as a series of tidyverse functions - you can now just use group_by()). Make two figures that plot the point estimates and 95% confidence intervals for each country - the first for men and the second for women. Compare the two sets of figures. For how many countries do you reject the null of no difference between college and non-college men (at \(\alpha = .05\))? For how many countries do you reject the null of no difference between college and non-college women (at \(\alpha = .05\))?

Problem 2

Part A

Instead of the difference-in-means, we will now estimate the full difference in the cumulative distribution functions of \(Y_i\) between \(G_i = 1\) and \(G_i = 0\). For \(g \in \{0, 1\}\) define the conditional CDF \(F_g(k) = P(Y_i \leq k \mid G_i = g)\) and its estimator, the empirical CDF:

\[\hat{F}_g(k) = \frac{1}{n_g} \sum_{i: G_i = g} \mathbb{1}\{Y_i \leq k\}\]

Define the difference in CDFs at each “rung” of the social status ladder question as:

\[D(k) = F_1(k) - F_0(k), \quad k = 1, \dots, 9\]

Interpret what \(D(k) > 0\) means in terms of how respondents with and without tertiary education place themselves on the social status ranking.

Part B

Compute \(\hat{F}_1(k)\) and \(\hat{F}_0(k)\) for \(k = 1, \dots, 10\) in Switzerland and plot both eCDFs as step functions in one graph.

Part C

We’ll use a non-parametric/pairs bootstrap to estimate the standard error for the difference in the empirical CDF at each “rung”. Write a function that takes the Swiss data as input and returns \(\hat{D}(1), \dots, \hat{D}(9)\). Then draw \(B = 2000\) bootstrap samples, setting the seed once to 53703. Compute your estimates on each bootstrap sample. Take the standard deviation of the bootstrap replicates of each of \(\hat{D}(1), \dots, \hat{D}(9)\) to estimate \(SE(\hat{D}(1)), \dots, SE(\hat{D}(9))\). Construct 95% confidence intervals for each \(D(k)\) using a normal approximation.

Plot each of your estimates \(\hat{D}(1), \dots, \hat{D}(9)\) along with the upper and lower bounds of your 95% confidence interval (use line width or color to distinguish the point estimate from the bounds – consider geom_ribbon() as well). Add a line at \(0\) and interpret your results. What do you notice about the difference in distributions?

Part D

Instead of the normal approximation, we’ll compute bootstrap percentile intervals. For each rung \(k\), calculate the 2.5th and 97.5th percentiles of your bootstrap replicates of \(\hat{D}(k)\) (use the quantile() function) - this is your estimated 95% confidence interval. Again, make a plot of your estimates \(\hat{D}(1), \dots, \hat{D}(9)\) but now with the upper and lower bounds of your percentile intervals. How do they compare to your intervals using a normal approximation?

Part E

In Part C, you built a separate 95% confidence interval for each rung. These are pointwise intervals. While the probability that any one interval covers the truth (under repeated sampling) is 95%, the probability that all nine cover their true values at the same time is less than 95%.

A uniform (simultaneous) confidence band fixes this problem (at the cost of being much wider). We will construct the bootstrap sup-t band (Montiel Olea and Plagborg-Møller 2019).

For each bootstrap draw in Part C, compute

\[M_b = \max_{k} \frac{|\hat{D}^{(b)}(k) - \hat{D}(k)|}{\widehat{se}(\hat{D}(k))}\]

where \(\widehat{se}\) is the bootstrap standard error from Part C (skip any \(k\) where it is zero). In other words, for each bootstrap draw, divide the absolute difference between the draw and your point estimate at each rung by that rung’s standard error, and take the largest of these across the 9 rungs.

Let \(c\) be the 95th percentile of \(M_1, \dots, M_B\). Construct the uniform confidence band \(\hat{D}(k) \pm c \cdot \widehat{se}(\hat{D}(k))\) and plot it as in Part C. Report this new critical value \(c\), and compare it with the usual 1.96. How do your results change from Part C?

References

Gidron, Noam, and Peter A. Hall. 2017. “The Politics of Social Status: Economic and Cultural Roots of the Populist Right.” The British Journal of Sociology 68 (S1): S57–84. https://doi.org/10.1111/1468-4446.12319.
ISSP Research Group. 2022. International Social Survey Programme: Social Inequality v - ISSP 2019. GESIS, Cologne. https://doi.org/10.4232/1.14009.
Montiel Olea, José Luis, and Mikkel Plagborg-Møller. 2019. “Simultaneous Confidence Bands: Theory, Implementation, and an Application to SVARs.” Journal of Applied Econometrics 34 (1): 1–17. https://doi.org/10.1002/jae.2656.