PH784: Problem Set #4

Author

Koichiro Shiba

Published

November 11, 2025

Panel data analysis

In this problem set, we will use the data WageData from the R package panelr.

These data come from the years 1976-1982 in the Panel Study of Income Dynamics (PSID), with information about the demographics and earnings of 595 individuals.

This dataset includes the following variables:

  • id: Unique identifier for each survey respondent
  • t: A number corresponding to each wave of the survey, 1 through 7
  • lwage: Natural logarithm of earnings in the past year
  • union: Binary indicator of whether respondent is a member of a union (1 = union member)
  • wks: Weeks worked in the past year
  • ms: Binary indicator of whether respondent is married (1 = married)
  • fem: Binary indicator of whether respondent is female (= 1)
  • blk: Binary indicator of whether respondent is African-American (= 1)
  • ed: Years of education

Note that this dataset is in a “long” format (i.e., each row represents a person-wave observation), and each individual id has multiple rows for different t.

Let’s say we want to estimate the effect of union membership (union) on earnings (lwage). After carefully selecting covariates, we fit the following regression model (see the line for lm()).

Model 1
term estimate conf.low conf.high p.value
(Intercept) 5.1 5 5.2 <.001
union 0.087 0.064 0.11 <.001
wks 0.0044 0.0024 0.0065 <.001
ms 0.13 0.093 0.17 <.001
fem -0.31 -0.36 -0.27 <.001
blk -0.13 -0.17 -0.092 <.001
ed 0.068 0.064 0.072 <.001
t 0.097 0.092 0.1 <.001

Now consider a different approach to model this data. The following code uses the lm() to fit a different model for the relationship union and lwage. Notice that the following table only shows the first estimates of the regression output by using the slice(1:4).

Model 2
term estimate conf.low conf.high p.value
(Intercept) 6 5.8 6.2 0
union 0.054 0.0048 0.1 0.032
wks 0.00096 -0.001 0.003 0.35
ms -0.084 -0.15 -0.021 0.0094

Q1. Explain how the second model differs from the first one in terms of adjusted covariates. Why do you think those changes were made?

Your answer

Q2. What is the exchangeability assumption we need to causally interpret the estimate for union (0.054)? Explain the specific assumption in words.

Your answer


Measuring social factors

Read the following article and answer Q3 and Q4. Do not spend a lot of time reading it — practice your skim reading skills!

  • Rundle, Andrew, et al. “Neighborhood food environment and walkability predict obesity in New York City.” Environmental health perspectives 117.3 (2009): 442-447.
    • https://ehp.niehs.nih.gov/doi/full/10.1289/ehp.11590

Q3. How did the authors measure individual-level socioeconomic status? Discuss strengths and limitations of their approach.

Your answer

Q4. Discuss potential limitations of their approach to measure “food environment”.

To answer this question, you can read the whole manuscript or only the following quote.

We defined a study subject’s neighborhood as a half-mile (805 m) “network buffer” around his or her residential address, comprising locations reachable within a half-mile walk along the street network.

We derived food environment measures from 2001 data purchased from Dun & Bradstreet (D&B; unpublished data). The data include business name, geocoded location, and detailed Standard Industrial Classification (SIC) industry codes (http://www.osha.gov/pls/imis/sic_manual.html) for food establishments. A priori, we grouped food outlets into categories hypothesized to provide BMI-healthy or BMI-unhealthy food, with one intermediate category for food outlets whose classification was uncertain.

The density per square kilometer of establishments falling within each of these three categories was calculated for each subject’s unique network buffer. Subjects were then categorized into increasing quintiles for each of the three food outlet categories.

Your answer