p-values and coefficients

You can use the .pvalues attribute on a fitted smf.ols regression model to retrieve the p-values for each coefficient.

Normally, p-values less than 0.05 are considered statistically significant.

Coefficients can be extracted from the fitted regression object using the .params attribute.

In this example, a statistically significant negative SMB ('Small Minus Big') coefficient would signify a factor exposure to large cap stocks, while a positive coefficient would signify an exposure to small cap stocks.

The fitted regression model FamaFrench_fit from the previous exercise is available in your workspace.

Este ejercicio forma parte del curso

Introduction to Portfolio Risk Management in Python

Ver curso

Instrucciones de ejercicio

  • Extract the p-value for 'SMB'.
  • Extract the regression coefficient for 'SMB'.

Ejercicio interactivo práctico

Pruebe este ejercicio completando este código de muestra.

# Extract the p-value of the SMB factor
smb_pval = FamaFrench_fit.____

# If the p-value is significant, print significant
if smb_pval < 0.05:
    significant_msg = 'significant'
else:
    significant_msg = 'not significant'

# Print the SMB coefficient
smb_coeff = FamaFrench_fit.____
print("The SMB coefficient is ", smb_coeff, " and is ", significant_msg)