User Tools

Site Tools


multiple_regression_exercise

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
multiple_regression_exercise [2021/11/25 20:44] – [Discussion 3] hkimscilmultiple_regression_exercise [2023/12/10 21:41] (current) – old revision restored (2022/11/02 23:41) hkimscil
Line 151: Line 151:
  
 <code> <code>
 +# install.packages("ISLR")
 +library(ISLR)
 +
 head(Carseats) head(Carseats)
 str(Carseats) str(Carseats)
Line 389: Line 392:
 아래는 설명을 하지 않고 코드만 적었었는데 이는 아래 둘의 model이 동일한 것임을 보여주기 위한 것입니다. 아래는 설명을 하지 않고 코드만 적었었는데 이는 아래 둘의 model이 동일한 것임을 보여주기 위한 것입니다.
 <code> <code>
-lm.2 <- lm(Sales ~ Advertising:ShelveLoc, data = Carseats) ------- (1)   +lm.2 <- lm(Sales ~ Advertising:ShelveLoc, data = Carseats) ------- (1)   
-lm.1 <- lm(Sales ~ Advertising + Advertising:ShelveLoc, data = Carseats) ------- (2)  +lm.1 <- lm(Sales ~ Advertising + Advertising:ShelveLoc, data = Carseats) ------- (2)  
 </code> </code>
  
Line 469: Line 472:
 Coefficients: Coefficients:
                             Estimate Std. Error t value Pr(>|t|)                                 Estimate Std. Error t value Pr(>|t|)    
-(Intercept)                  5.01234    0.31932  15.697  < 2e-16 ***       (1) +(Intercept)                  5.01234    0.31932  15.697  < 2e-16 ***    # (1) 
-ShelveLocGood                4.43573    0.48146   9.213  < 2e-16 ***       (2) +ShelveLocGood                4.43573    0.48146   9.213  < 2e-16 ***    # (2) 
-ShelveLocMedium              1.59511    0.38378   4.156 3.97e-05 ***       (3) +ShelveLocMedium              1.59511    0.38378   4.156 3.97e-05 ***    # (3) 
-ShelveLocBad:Advertising     0.08210    0.03570   2.300  0.02198 *         (4) +ShelveLocBad:Advertising     0.08210    0.03570   2.300  0.02198 *      # (4) 
-ShelveLocGood:Advertising    0.10417    0.03607   2.888  0.00409 **        (5) +ShelveLocGood:Advertising    0.10417    0.03607   2.888  0.00409 **     # (5) 
-ShelveLocMedium:Advertising  0.10692    0.02280   4.689 3.78e-06 ***       (6)+ShelveLocMedium:Advertising  0.10692    0.02280   4.689 3.78e-06 ***    # (6)
 --- ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Line 754: Line 757:
 library(ppcor) library(ppcor)
 attach(Carseats) attach(Carseats)
-spcor.Price <- spcor.test(Price, Sales, CompPrice) +spcor.Price <- spcor.test(Sales, Price, CompPrice) 
-spcor.CompPrice <- spcor.test(CompPrice, Sales, Price)+spcor.CompPrice <- spcor.test(Sales, CompPrice, Price)
  
 spcor.Price spcor.Price
Line 776: Line 779:
  
 # 이 둘을 더해봅니다.  # 이 둘을 더해봅니다. 
-# 이 값은 0.3648334 입니다+# 이 값은 0.5135791 입니다
 b + d b + d
  
Line 799: Line 802:
 </code> </code>
    
 +--> 
 +[[:Suppressor in Multiple Regression]]
 ====== Making Questionnaire ====== ====== Making Questionnaire ======
 [[https://eclass2.ajou.ac.kr/webapps/discussionboard/do/forum?action=list_threads&course_id=_47711_1&nav=discussion_board_entry&conf_id=_52871_1&forum_id=_55560_1|Questions]] you submit at the ajoubb. [[https://eclass2.ajou.ac.kr/webapps/discussionboard/do/forum?action=list_threads&course_id=_47711_1&nav=discussion_board_entry&conf_id=_52871_1&forum_id=_55560_1|Questions]] you submit at the ajoubb.
multiple_regression_exercise.1637840648.txt.gz · Last modified: 2021/11/25 20:44 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki