Fitlm error with predictor and response variables
10 views (last 30 days)
Show older comments
I am trying to run a regression model on 83 funds and their returns. I have started by dividing them by 100 then subtracting the risk free rate. I am using fama french 6 factor model. I have attached photos for context, R1 is my returns, ff5 is my factor model, Rf is my risk free rate. Any help in understanding why I am getting the error regardign predictor and resposne variables would be apprecaited, when using the fama french 6 model factor how do I integreate this into my analysis. Thanks
6 Comments
Ive J
on 19 Dec 2020
Sorry I haven't received any MATLAB notification on this post.
Please share your data properly (not as image). Show you code also and the output you get from MATLAB. For instance,
x = rand(10, 2); % test predictor
y = rand(10, 1); % test reponse
mdl = fitlm(x, y)
Linear regression model:
y ~ 1 + x1 + x2
Estimated Coefficients:
Estimate SE tStat pValue
_________ _______ ________ _______
(Intercept) 0.4717 0.25349 1.8609 0.10508
x1 -0.087938 0.33145 -0.26532 0.79841
x2 0.010793 0.31584 0.034172 0.97369
Number of observations: 10, Error degrees of freedom: 7
Root Mean Squared Error: 0.27
R-squared: 0.0112, Adjusted R-Squared: -0.271
F-statistic vs. constant model: 0.0397, p-value = 0.961
Your image simply shows your design matrix is rank deficient (test stats are NaN or Inf), so either your data is problematic or the way you process them. That's why it's crucial to show all details/information you can when you ask a question.
Answers (0)
See Also
Categories
Find more on Multivariate Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!