MATLAB: How to get p-value, RMSE out of fitlm fitlmMATLAB I use mdl = fitlm(X,y,'robust','on') to get the statistics of my regression, and I know how to get the Rsquare: R2 = md1.Rsquared.Ordinary; My question is how do I get the p-value and RMSE out of the fitlm results? Thanks. Best Answer mdl = fitlm(rand(7,1),rand(7,1)) mdl.RMSE mdl.Coefficients.pValueDescribed on this documentation page. Related SolutionsMATLAB: How to get the p-value as an output of fitlm Try this:p_val = mdl.Coefficients.pValue;That will give you the p-values of the coefficients (from the t-statistic). MATLAB: How to get the constant term when performing multiple linear regression using STEPWISEFIT The constant term of the model corresponds to the "intercept" field of the output structure STATS and can be obtained as follows:b0 = STATS.intercept Related QuestionHow to make intercept 0 in fitlmHow to find the standard deviation of the linear regressionExtract model’s p-value from fitnlmHow to prevent a stepwise multiple linear regression to include interaction terms
Best Answer