STAT545-UBC-hw-2018-19 / hw06-MeiqiYu

hw06-MeiqiYu created by GitHub Classroom
0 stars 0 forks source link

Peer review #1

Open YuHsiangLo opened 5 years ago

YuHsiangLo commented 5 years ago

Peer-Review HW-06 for @MeiqiYu

Topic Excellent Satisfactory Needs Work
Coding style :heavy_check_mark:
Coding strategy :heavy_check_mark:
Presentation: graphs :heavy_check_mark:
Presentation: tables :heavy_check_mark:
Achievement, creativity :heavy_check_mark:
Ease of access :heavy_check_mark:

Remarks:

MeiqiYu commented 5 years ago

Hi, YuHsiangLo

Thanks to your review. I'm sorry that part of my results don't show up in md file, you could check the html version provided here.

Regarding to the mistake you pointed out, I' ve tested both with lifeExp ~ I(year - 1952) + I((year - 1952)^2) and lifeExp ~ I(year - 1952) + I((year - 1952)^2) . The results turn out to be the same including Intercept value, residual standard error , multiple R-squared and etc. I don't understand why you said that these two formulas produce different results. I highly recommend you test both of those first.

By the way, do you have any remarks on the first part of my assignment? I cannot find any comments on that.

Thanks agian for your review.

Maggie

YuHsiangLo commented 5 years ago

Hi again,

I think your did great in the first part, so I didn't leave any comments.

Regarding the regression models, notice that the first-order terms are different in the two models, one have slope of 82.172151 and the other 1.049839.

# This is what you have in your implementation
gapminder %>%
  filter(country == "Zimbabwe") %>%
  lm(data = ., lifeExp ~ I(year - 1952) + I(year^2 - 1952^2)) %>%
  summary()

Call:
lm(formula = lifeExp ~ I(year - 1952) + I(year^2 - 1952^2), data = .)

Residuals:
    Min      1Q  Median      3Q     Max 
-6.2522 -2.7543 -0.6202  2.7916  5.9329 

Coefficients:
                    Estimate Std. Error t value Pr(>|t|)    
(Intercept)        45.697407   3.107870  14.704 1.34e-07 ***
I(year - 1952)     82.172151  18.220039   4.510  0.00147 ** 
I(year^2 - 1952^2) -0.020779   0.004602  -4.515  0.00146 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4.203 on 9 degrees of freedom
Multiple R-squared:  0.711, Adjusted R-squared:  0.6467 
F-statistic: 11.07 on 2 and 9 DF,  p-value: 0.003753

# This should be the correct one
gapminder %>%
  filter(country == "Zimbabwe") %>%
  lm(data = ., lifeExp ~ I(year - 1952) + I((year - 1952)^2)) %>%
  summary()

Call:
lm(formula = lifeExp ~ I(year - 1952) + I((year - 1952)^2), data = .)

Residuals:
    Min      1Q  Median      3Q     Max 
-6.2522 -2.7543 -0.6202  2.7916  5.9329 

Coefficients:
                    Estimate Std. Error t value Pr(>|t|)    
(Intercept)        45.697407   3.107870  14.704 1.34e-07 ***
I(year - 1952)      1.049839   0.262699   3.996  0.00313 ** 
I((year - 1952)^2) -0.020779   0.004602  -4.515  0.00146 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4.203 on 9 degrees of freedom
Multiple R-squared:  0.711, Adjusted R-squared:  0.6467 
F-statistic: 11.07 on 2 and 9 DF,  p-value: 0.003753