fitlm how to save predicted values?

8 次查看(过去 30 天)
Hey! For further calculations I need to use my predicted values of my linear model. Using fitlm I get e.g. mdl =
Linear regression model: MPG ~ 1 + Weight + Year + Weight^2
Estimated Coefficients: Estimate SE tStat ________ ________ _____
(Intercept) 54.206 4.7117 11.505
Weight -0.016404 0.0031249 -5.2493
Year_76 2.0887 0.71491 2.9215
Year_82 8.1864 0.81531 10.041
Weight^2 1.5573e-06 4.9454e-07 3.149
pValue
__________
(Intercept) 2.6648e-19
Weight 1.0283e-06
Year_76 0.0044137
Year_82 2.6364e-16
Weight^2 0.0022303
Number of observations: 94, Error degrees of freedom: 89 Root Mean Squared Error: 2.78 R-squared: 0.885, Adjusted R-Squared 0.88 F-statistic vs. constant model: 172, p-value = 5.52e-41
Here I have 94 actual values, how can I get the predicted values of these? E.g if I have 94 actual prices, how can i get the predicted prices through my model (best would be in an array).
Thanks a lot!

采纳的回答

Star Strider
Star Strider 2014-7-10
See if predict does what you want.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by