Get Started

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.

This is a part of the course

“Introduction to Portfolio Risk Management in Python”

View Course

Exercise instructions

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

Hands-on interactive exercise

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

# 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)
Edit and Run Code