Linear regression model with fitlm
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have two arrays and I am doing a weighted correlation with the function fitlm.
If I write:
tbl = table(ones(9,1),a(:),b(:),'VariableNames',{'Weight','array1','array2'});
correlation = fitlm(tbl)
I get:
correlation =
Linear regression model: map2 ~ 1 + Weight + map1
Estimated Coefficients: Estimate SE tStat pValue ______ _____ ______ ______
(Intercept) 0.66696 0.24971 2.671 0.036979
Weight 0 0 NaN NaN
map1 -0.22041 0.39988 -0.55119 0.60141
Number of observations: 9, Error degrees of freedom: 7 Root Mean Squared Error: 0.292 R-squared: 0.0416, Adjusted R-Squared -0.0953 F-statistic vs. constant model: 0.304, p-value = 0.599
In correlation I can find almost all the values printed in the workspace, with the exeption of the p-value = 0.599
Why? Where is it and what is it?
Thank you.
0 commentaires
Réponse acceptée
Star Strider
le 7 Août 2018
You may have to do a separate anova call to get it:
Anova = anova(correlation);
AnovaP = Anova.pValue(2);
That works for your model.
(I usually am interested in the coefficient statistics, that are generally easier to recover.)
2 commentaires
Star Strider
le 7 Août 2018
My pleasure.
If my Answer helped you solve your problem, please Accept it!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Analysis of Variance and Covariance dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!