I have a financial data.frame that contains quarterly data for each stock in S&P500 - 16 quarters for each stock, a total of 8000 rows. What I am trying to do is to explain 30-day volatility (Dependent Variable) with Profit Margin as our Independent Variable. Intuitively a company with a larger profit margin should experience less volatility. Here is a quick glimpse of the dataset.

 ticker date       VOLATILITY_30D PROF_MARGIN
  <chr>  <date>              <dbl>       <dbl>
1 A      2019-11-25           14.1        14.2
2 A      2019-08-14           24.9        15.0
3 A      2019-05-14           26.2        14.7
4 A      2019-02-20           16.0        39.3
5 A      2018-11-19           33.7        15.1
6 A      2018-08-14           18.6        19.6

What I need help with is how to identify and get the most information out of a weak predictor.

What follows is some EDA. First I plot a histogram of both our DV(30D Volatility) and IV(Profit Margin. enter image description here

Since Prof_MARGIN is much more normal looking than 30D Volatility I decide to run a Spearman correlation between the 2 as the relationship is unlikely to be linear.

cor(x = data$PROF_MARGIN, y = data$VOLATILITY_30D, method = "spearman")
[1] -0.124287 
# There is a negative correlation of 12% between the 2.

Next, I decide to scale and center the data before plotting their relationship.

data = data %>% mutate(VOLATILITY_30D = scale(VOLATILITY_30D),
                       PROF_MARGIN = scale(PROF_MARGIN))
plot(VOLATILITY_30D ~ PROF_MARGIN, data = data)

enter image description here

Clearly, this relationship looks extremely week. The adjusted R^2 is .015 with a T Stat of -10.6.

Lastly, I decided to calculate the average volatility for each stock and regress that on the average profit margin for each stock. The idea here is to reduce some of the noise.

Our new data.frame now looks like this.

dataMeans = data %>% group_by(Ticker)%>%summarise(Mean_Prof_Margin = mean(PROF_MARGIN, na.rm = T),
                                                  Mean_Volatility = mean(VOLATILITY_30D, na.rm = T))
Ticker Mean_Prof_Margin Mean_Volatility
  <chr>             <dbl>           <dbl>
1 A                13.3              20.9
2 AAL               5.97             35.7
3 AAP               4.73             25.9
4 AAPL             21.2              20.8
5 ABBV             20.5              27.2
6 ABC               0.677            26.6

(below is scaled and centered graph) enter image description here

Our R^2 has increased to .064 and is statistically significant.

My question is what other methods can I use to try and get more information out of my predictor variable? Is Prof_Margin strong enough to incorporate in a trading model? How would you approach a situation like this?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.