I'm using lm = fitlm(X,y,'linear')
it works nicely and outputs
lm =
Linear regression model:
y ~ 1 + x1 + x2 + x3
Estimated Coefficients:
Estimate SE tStat pValue
(Intercept) 2.1338 0.27403 7.7869 1.6357e-13
x1 0.07202 0.01757 4.0991 5.5484e-05
x2 -0.35927 0.12078 -2.9746 0.0032094
x3 0.020363 0.0041479 4.9092 1.6168e-06
Number of observations: 264, Error degrees of freedom: 260
Root Mean Squared Error: 0.835
R-squared: 0.154, Adjusted R-Squared 0.144
F-statistic vs. constant model: 15.8, p-value = 1.93e-09
somethings like this.
However i want to get the F-statistic
value of each model (in a loop) and export to a file. My problem is.. I can't find the variable of lm
that contains F-statistic
and it's pvalue
; Also lm.Steps
is empty..
================================================================================
And another question, under what condition should I use this regression results? if x1
is the component i want after regressing out other component and residuals, should I say x1
is responsible for y when p-value of x1 is less than 0.05 or p-value of the model is less than 0.05?