# where is the pvalue of the model stored in fitlm or fitglm?

41 visualizzazioni (ultimi 30 giorni)
Theo il 26 Ott 2014
I'm looking for the model pvalue in comparison to the constant interception, not the variable pvalues. Thanks
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Dameng Yin il 15 Nov 2018
Modificato: Dameng Yin il 15 Nov 2018
I had the same question. While looking for the answer online, I found the answer to this from here: StackOverflow.
This would work for fitlm as well:
p = coefTest(mdl);
I'm using Matlab 2018a. Not sure if the function is available in previous versions.
Best.
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Adam Danz il 15 Mag 2019
And to get the f-statistic too,
[p,f] = coefTest(mdl);

Accedi per commentare.

### Più risposte (3)

yanarof foranay il 28 Set 2018
This answer may come a bit late, but at least it can help people that google the same problem (like me):
The p-value of the F-statistic vs. constant model (for the fitglm) can be retrieved like this:
pVal = RL_Model.devianceTest.pValue;
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Guillermo Quintas il 9 Feb 2023
yes! thanks!

Accedi per commentare.

Tom Lane il 27 Ott 2014
Try this:
lm = fitlm(ingredients,heat)
lm.Coefficients.pValue(1)
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Theo il 28 Ott 2014
Thanks but that's not what I want. That's the pvalue of the intercept or basically each of the predictors. I'm looking for the model pvalue in comparison to the constant intercept. in your example for instance it's F-statistic vs. constant model: 111, p-value = 4.76e-07

Accedi per commentare.

Duijnhouwer il 25 Mar 2016
This works (Matlab 2015b):
M=fitlm(ingredients,heat)
T=anova(M,'summary')
F=table2array(T(2,4))
pValue=table2array(T(2,5))
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Dimensionality Reduction and Feature Extraction in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by