Financial Technology: Methods and Practice
Instructions:
Final Exam
individual exam
• This is a take-home and . There are 14 (part I) +13 (part II) +2 (part III)=29 tasks.
o Collaboration on the final exam violates academic integrity.
Submission is due May 6 midnight. Technical reasons are not valid for a deadline extension.
Your submission must include the following:
o Failure to submit your complete write-up may result in a deduction of 20% from your final exam score.
full code
2. Your in a separate file (or two separate files). Acceptable formats are .R, .ipynb, .Rmd, and .py.
o Non-executable code may result in a final exam score of close to 0.
o Code execution time should be reasonable (less than 10 minutes for part I and less than 30 minutes for part II). Longer execution time may result in a deduction of 10% from your final exam score.
• Include proper and verifiable citations for storytelling/open questions (if applicable).
Introduction
Part I: Consumer credit sub-project
In this exercise, you want to understand whether more restrictive debt collection regulations lead consumers to borrow money from non-traditional credit such as payday loans. Creditors, especially traditional creditors such as credit card companies, commonly turn to third-party debt collectors to collect past-due payments. On the other hand, payday lenders do not usually rely on third-party debt collectors.
On Canvas, under Files –second half–final exam–data–Part I, you can find the below two datasets:
a) state.csv: contains macroeconomic variables (e.g., unemployment rates and income per capita) for each state over time. It also includes the year when a state adopts restricting debt collection practices (variable ‘𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙_𝑦𝑦𝑙𝑙𝑙𝑙𝑦𝑦’). This data is at state-year level.
b) consumer_credit.xlsx: contains consumer credit information. Consumers in this dataset reside in counties at the border of states. This data is at consumer-state-year level.
Tasks:
1. Load state.csv into R (or Python) as a data frame ‘𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙’ . Report the number of observations, mean, median, standard deviation, min, and max of state income per capita ( "𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑖𝑖𝑙𝑙" ), state population ( "𝑝𝑝𝑙𝑙𝑝𝑝" ), and state medical expenditures per capita ("h𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙h_𝑙𝑙𝑒𝑒𝑝𝑝").
Read and process state legislation data
2. Create a variable ‘𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑒𝑒’, which is equal to 0 before the first debt collection legislation change in state 𝑙𝑙, 1 after (including the legislation change year) the first legislation change, 2 after the same state enacts the second legislation change, and 3 after the same state enacts another legislation change. For instance, Illinois had two regulation changes in 2005 and 2013, separately. ‘𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑒𝑒’ should be equal to 0 during 2000-2004, equal to 1 during 2005- 2012, equal to 2 in 2013 and afterward; Alabama never had regulation changes during the sample period, ‘𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑒𝑒’ should always be equal to 0. This variable measures the restrictiveness of debt collection legislation. 𝑠𝑠,𝑡𝑡
3. Create a variable ‘𝑝𝑝𝑙𝑙𝑙𝑙𝑙𝑙’ (𝑝𝑝𝑙𝑙𝑙𝑙𝑙𝑙 ). Its value is 0 before the first legislation change in state 𝑙𝑙 and 1 after. For instance, for Illinois state, its value should be equal to 0 during 2000-2004 and 1 starting from 2005. For Alabama state, its value should always be equal to 0.
4. Create a variable ‘𝑙𝑙𝑦𝑦𝑙𝑙𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑙𝑙𝑙𝑙’ (𝑙𝑙𝑦𝑦𝑙𝑙𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑙𝑙𝑙𝑙 ). Its value is equal to 1 for states that adopt
restrictions in debt collection practices, otherwise 0. Its value should always be equal to 1 for Illinois and 0 for Alabama.
5. Load consumer_credit.xlsx as a data frame ‘𝑖𝑖𝑙𝑙𝑙𝑙𝑙𝑙𝑐𝑐𝑖𝑖𝑙𝑙𝑦𝑦_𝑖𝑖𝑦𝑦𝑙𝑙𝑖𝑖𝑙𝑙𝑙𝑙’. Report the mean, median, and standard deviation of these four variables: credit score, W2 income, payday loan amount (“𝑝𝑝𝑙𝑙𝑦𝑦𝑖𝑖𝑙𝑙𝑦𝑦_𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙”), and total traditional loan amount ( “𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙_𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙” ). The summary statistics should be presented in one table.
Read and process consumer credit data
6. Create two variables: the logarithm of total traditional loan amount and the logarithm of payday loan amount. Assign 0 if the value of payday loan amount or total traditional loan amount is 0.
7. Generate a variable called ‘𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑖𝑖𝑙𝑙_𝑞𝑞𝑐𝑐𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙’ by year. The value for 𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑖𝑖𝑙𝑙_𝑞𝑞𝑐𝑐𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 is from 1 to 5, where 1 represents the lowest W2 income group and 5 represents the highest W2 income group. Create a bar chart where the x-axis is the income quintile and the y-axis shows the median total traditional loan amount for each income quintile.
8. Merge 𝑖𝑖𝑙𝑙𝑙𝑙𝑙𝑙𝑐𝑐𝑖𝑖𝑙𝑙𝑦𝑦_𝑖𝑖𝑦𝑦𝑙𝑙𝑖𝑖𝑙𝑙𝑙𝑙 data frame with 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 data frame by state and year. Regressions
9. Regress credit outcomes on 𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑒𝑒, controlling for W2 income. The credit outcomes are credit score, log of total traditional loan amount, and log of payday loan amount. Then report coefficients (along with their p-values and t-statistics) for the 3 regressions.
10. Run the following 2SLS regression:
Stage 1: Regress log of total traditional loan amount on 𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑒𝑒, controlling for W2 income.
Stage 2: Regress log of payday loan amount on the fitted value of log of total traditional loan amount, controlling for W2 income.
Run a DID regression: regress log of payday loan amount on 𝑙𝑙𝑦𝑦𝑙𝑙𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑙𝑙𝑙𝑙 times 𝑝𝑝𝑙𝑙𝑙𝑙𝑙𝑙 , controlling for W2 income. Based on the sign on the interaction, do you get consistent result to task 10?
Rerun the DID specified in task 11 for each income quintile. Generate a table that collects the regression coefficients (along with their t-statistics, standard errors, and p-values) on the interaction term.
Show your second-stage result. Your output should have the right standard errors.
13. Explain why changes in debt collection legislation (𝑙𝑙𝑙𝑙𝑖𝑖𝑙𝑙𝑒𝑒) is a good instrument for task 10.
14. The state legislators tighten debt collection regulations to protect consumers. Do your results support that more restrictive debt collection regulations benefit consumers? Why or why not?
......