fitlm how to save predicted values?

조회 수: 9 (최근 30일)
Tania
Tania 2014년 7월 10일
댓글: Star Strider 2014년 7월 10일
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.
  댓글 수: 2
Tania
Tania 2014년 7월 10일
Thanks,think I found it, Fitted shows my predicted values.
Star Strider
Star Strider 2014년 7월 10일
My pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by