首页 > > 详细

讲解 IRE379 Homework 8 - Interpreting Interaction Effects讲解 R语言

Homework 8 - Interpreting Interaction Effects

IRE379


Figure 1: UAW Organizing in Detroit

Introduction

Before analyzing data, we often must do some ‘data wrangling’—reading, reshaping, merging, and cleaning data to make it useful for analysis. This assignment practices some basic data wrangling, before moving on the interpretation of coefficients from interaction models.

1    Merging datasets

The Blau and Kahn PSID data has been split into two datasets, one containing demographics (PSID_demographics.csv) and the other containing the respondents’ employment outcomes (PSID_jobs.csv). Fortunately, each respondent is identified with a numeric code that is the same in both datasets:  id. Read  these two data sets into memory, and then use the function left_join() to merge them into a single dataset, using the column id as the key for merging.

2    Race, wages, and union coverage

2.1    Binary X  (No interaction effects)

Fit the bivariate regression model Yi  = β0 + β1 Di + ui  with average wage as the dependent variable and a dummy variable indicating whether the respondent was white as the independent variable. Using only the regression output, what are the following values?

•  Estimated mean wage for white respondents

•  Estimated mean wage for non-white respondents

2.2    Subgroup means from an interaction model

Fit the interaction model Yi  = β0 + β1 D1i + β2 D2i + β3 (D1i * D2i) + ui  with average wage as the dependent variable and binary indicator (dummy) variables for white identity and union coverage as the independent variables. Using only the regression output, what are the following values?

•  Estimated mean wage for white respondents without union coverage

•  Estimated mean wage for non-white respondents without union coverage

•  Estimated mean wage for white respondents with union coverage

•  Estimated mean wage for non-white respondents with union coverage

2.3    Conrming the subgroup means

Use filter() to create 4 separate datasets for each permutation of white (0, 1) and union coverage (0, 1). Calculate the mean wage within each dataset and compare to your results from the previous question.

2.4    Interaction effect interpretation

What does the coefficient on ‘white:unjob’ tell us? Why might this be true?





联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!