| 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 |
PH784: Problem Set #4
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 respondentt: A number corresponding to each wave of the survey, 1 through 7lwage: Natural logarithm of earnings in the past yearunion: Binary indicator of whether respondent is a member of a union (1 = union member)wks: Weeks worked in the past yearms: 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()).
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).
| 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 |