User Tools

Site Tools


r:multiple_regression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
r:multiple_regression [2019/11/08 09:28] hkimscilr:multiple_regression [2019/11/08 10:59] – [Prediction] hkimscil
Line 253: Line 253:
 coefficients(lm.stock) coefficients(lm.stock)
 </code> </code>
 +
 +<code>> names(lm.stock)
 + [1] "coefficients"  "residuals"     "effects"       "rank"          "fitted.values"
 + [6] "assign"        "qr"            "df.residual"   "xlevels"       "call"         
 +[11] "terms"         "model"      </code>
 +
  
 <code>> lm.stock <- lm(Stock_Index_Price~Interest_Rate+Unemployment_Rate, data=dat.stock) <code>> lm.stock <- lm(Stock_Index_Price~Interest_Rate+Unemployment_Rate, data=dat.stock)
Line 512: Line 518:
 </code> </code>
  
 +Alternatively,
  
 +<code>
 +> install.packages("lmtest")
 +> library(lmtest)
 +> lrtest(lm.stock.int, lm.stock)
 +Likelihood ratio test
 +
 +Model 1: Stock_Index_Price ~ Interest_Rate
 +Model 2: Stock_Index_Price ~ Interest_Rate + Unemployment_Rate
 +  #Df  LogLik Df  Chisq Pr(>Chisq)  
 +1   3 -136.94                       
 +2   4 -134.61  1 4.6576    0.03092 *
 +---
 +Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 +> </code>
  
r/multiple_regression.txt · Last modified: 2023/10/19 08:23 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki