Get startedGet started for free

Practice Computing Causal Effects Using Indirect Inference: CreditCo

Now let's repeat the previous CreditCo analysis, but now use indirect inference to compute the causal effect of opting in to a credit limit increase on one's credit balance.

The setting is the same as before. CreditCo sent out offers in the mail to increase their customers' credit limits. But we know that taking up the offer is not randomly determined. We proposed to solve this problem by using the whether it rained on the day the credit offers were delivered as an instrument for takeup.

In this exercise, we will restrict our analysis to the set of customers who received the offer. We will use the method of indirect inference to estimate the causal effect of takeup on credit balance.

Included on the workspace is a data set from CreditCo. The data are a sample of CreditCo customers who were offered the credit limit increase. We will focus on the variable rainy, which we will use as an instrument for opt_in, which we suspect is endogenous to our outcomes of interest.

This exercise is part of the course

Causal Inference with R - Instrumental Variables & RDD

View Course

Exercise instructions

  • 1) Using a linear regression, compute the reduced-form effect (i.e. correlation between credit balance and rain)
  • 2) Using a linear regression, compute the first-stage effect (i.e. correlation between opting in and rain)
  • 3) Now compute the causal effect, which is equal to (reduced form)/(first stage)
  • 4) Did opting in to the credit offer increase or decrease credit balances?

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# The dataset `CreditCo` is available in your workspace. Again, here is a data dictionary to help you make sense of the variable names and what they are representing:

# Data Dictionary:

#  `id` - customer ID
#  `offered` - did customer get the offer for a higher limit?
#  `opt_in` - did the customer opt into the higher limit?
#  `FICO` - an industry standard credit rating score per customer
#  `age` - customer age
#  `female` - 1 if gender is female
#  `race_white` -  1 if race is recorded as white, 0 if anything else
#  `default_pre` - customer's default rate before the offer
#  `default_post` - customer's default rate after the offer
#  `balance_pre` - customer's credit balance before the offer
#  `balance_post` - customer's credit balance after the offer
#  `rainy` - TRUE if it rained at the customer's house
#  `coefficients` - where we will store coefficients from our regressions


# In order to see if a higher credit limit will make people buy more things with their credit cards, we  will use indirect inference to calculate the causal effect of getting a credit card offer on the credit balances of the customers. This will take 3 steps: first, we will calculate the correlation between our instrument and our outcome variable, then we will calculate the correlation between our instrument and our treatment, and then we'll find the ratio between these correlations.

# 1) Using a linear regression, compute the reduced-form effect (i.e. correlation between `balance_post` and `rainy`),and then run the summary() command to look at the correlation coefficient between the outcome and the instrument.

    Solution1<-lm( ~ ,data=CreditCo)
    summary()

# 2) Using a linear regression, compute the first-stage effect (i.e. correlation between `opt_in` and `rainy`), and then run the summary() command to look at the correlation coefficient between the treatment and the instrument.

    Solution2<-lm( ~ ,data=CreditCo)
    summary()

# 3) Compute the causal effect, which is equal to (reduced form)/(first stage), then look at the result :

    Solution3<-Solution1$coefficients[2]/Solution2$coefficients[2]
    Solution3

# 4) Did opting in to the credit offer make customer's credit balances increase or decrease? (type "increase" if Solution3 is positive or "decrease" if Solution3 is negative)

    Solution4<-""

Edit and Run Code