Extract model's p-value from fitnlm
Afficher commentaires plus anciens
Dear all,
I am using the Statistical Toolbox (Matlab2013b) to perform a regression analysis. Using apply different regression functions to my dataset (linear,quadratic,exponential) using "fitnlm". I want to choose the best function based on R^2 and p-value. The R^2 is found in the model's output fields. The overall p-value I can't find though it is displayed in the command window: Nonlinear regression model, e.g.:
y ~ b1*x1^2 + b2*x1 + b3
Estimated Coefficients:
Estimate SE tStat pValue
b1 0.02495 0.010583 2.3575 0.027708
b2 -0.75062 1.0529 -0.71294 0.48337
b3 14.633 24.854 0.58877 0.56201
Number of observations: 25, Error degrees of freedom: 22 Root Mean Squared Error: 8.27 R-Squared: 0.897, Adjusted R-Squared 0.887 F-statistic vs. constant model: 95.5, p-value = 1.43e-11
My tool should extract the model p-value = 1.43e-11 automatically (not the individual coefficients' pValue in the table). How can I do this?
Thanks!
Réponse acceptée
Plus de réponses (2)
the cyclist
le 14 Avr 2014
0 votes
It seems to me from the documentation that the p-value is not an output.
The F-test calculation is in the file NonLinearModel.m. [Lines 800-834 is the ftest() function in R2014a.] I haven't checked, but it looks like you might be able to reconstruct the p-value from the other outputs.
2 commentaires
Steven
le 14 Avr 2014
the cyclist
le 14 Avr 2014
Type
edit NonLinearModel
at the command prompt
(Be careful not to make changes. You might want to copy that another file.)
Catégories
En savoir plus sur Nonlinear Regression dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!