Database Connectivity and Financial Data Analysis Using Python

For This or a Similar Paper Click Here To Order Now

Total 20 Points.(You can submit/upload the complete ipynb file in the canvas)
Task A. Data Visualization: 4 pointsGet the data “30_Industry_Portfolios.csv” data and “F-F_Research_Data_Factors.CSV” from class google drive.
For both data select date from January 01, 2000 to December 31, 2018
Draw a 2*2 scatterplot that reflect the relationship between (1) mkt-rf and food, (2) SMB and food, (3) mkt-rf and games and (4) SMB and games.
From the scatterplot what kind of relationshiop you see. [explain in words]
Task B. Regression Specification- Use the OLS function to estimate the follwoing: 10 PointsRun two univariate regression on Food and Games using excess market return (mkt-rf) as the dependent variable. Include a constant in the regressions.
Report the coefficient and t-stat of the market in this both industry, are they significant?
Report the R-squares of the models.
Run a multivarite regression for this two industry return (Food and Games) using all three Fama French Factors ( Market, SMB and HML).
Report the coefficient and t-stat of all three factors in both models, are they significant?
Report the R-squares of the models.
Is their any difference in the R-squares on 3 and 6. What doese this mean?
Task C. White’s covariance estimator: 6 pointsRe-estimate the two multivarite regression (Task B.4) with White’s covariance estimator.
Report the coefficient and t-stat of all three factors in both models, are they significant?
Are the parameter standard errors similar using the two covariance estimators (homoskedastic errors in Task B.4 and White’s covariance estimator). If not, what does this mean?

 

šŸ“ Struggling with where to start this assignment? Follow this guide to tackle your assignment easily!


Step-by-Step Guide to Completing the Assignment

Task A: Data Visualization (4 points)

  1. Load the data

    • Import the datasets “30_Industry_Portfolios.csv” and “F-F_Research_Data_Factors.CSV” into Python using pandas.
    • Filter the data to include only dates between January 1, 2000, and December 31, 2018.
  2. Create Scatterplots

    • Use Matplotlib or Seaborn to plot four 2×2 scatterplots:
      • (1) MKT-RF vs. Food
      • (2) SMB vs. Food
      • (3) MKT-RF vs. Games
      • (4) SMB vs. Games
    • Label axes and titles properly.
  3. Interpret the Scatterplots

    • Observe the relationship between variables:
      • Are they positively or negatively correlated?
      • Do they have a strong or weak relationship?

Task B: Regression Specification (10 points)

Step 1: Univariate Regression (2 models)

  1. Use the OLS (Ordinary Least Squares) function from statsmodels to estimate two regressions:

    • Dependent Variable: Excess Market Return (MKT-RF)
    • Independent Variables:
      • Model 1: Food
      • Model 2: Games
    • Include a constant in the regression.
  2. Report Findings

    • Extract and report:
      • Coefficient & t-statistic for MKT-RF in both regressions.
      • Significance (p-value < 0.05 means it is statistically significant).
      • R-squared values to evaluate model fit.

Step 2: Multivariate Regression

  1. Estimate two multiple regressions:

    • Dependent Variables:
      • Model 3: Food
      • Model 4: Games
    • Independent Variables:
      • Market (MKT-RF)
      • SMB
      • HML
  2. Report Findings

    • Extract and analyze:
      • Coefficients & t-statistics for MKT-RF, SMB, and HML.
      • Significance levels (p-values).
      • R-squared values for both models.
  3. Compare R-Squared Values

    • Is the R-squared higher in the multivariate model than in the univariate?
    • What does this tell you about the importance of SMB and HML factors?

Task C: White’s Covariance Estimator (6 points)

  1. Re-run the multivariate regressions (Task B, Step 2)

    • This time, use White’s covariance estimator to adjust for heteroskedasticity.
  2. Compare Standard Errors

    • Extract coefficients and t-statistics.
    • Compare standard errors from homoskedastic (Task B) vs. heteroskedastic (White’s estimator) models.
  3. Interpret Findings

    • If standard errors change significantly, heteroskedasticity is present.
    • What does this mean for reliability?

Technical Requirements

  • Submit a Jupyter Notebook (.ipynb) file.
  • Use Python with pandas, numpy, matplotlib/seaborn, and statsmodels.
  • Label all charts and tables properly.
  • Ensure code is clean, commented, and well-structured.

Let me know if you need further clarifications! šŸš€

For This or a Similar Paper Click Here To Order Now

WRITE MY ESSAY