My models:
summary(m1)
##
## Call:
## lm(formula = len ~ dose, data = ToothGrowth)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.4496 -2.7406 -0.7452 2.8344 10.1139
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.4225 1.2601 5.89 2.06e-07 ***
## dose 9.7636 0.9525 10.25 1.23e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.601 on 58 degrees of freedom
## Multiple R-squared: 0.6443, Adjusted R-squared: 0.6382
## F-statistic: 105.1 on 1 and 58 DF, p-value: 1.233e-14
summary(m2)
##
## Call:
## lm(formula = len ~ supp + dose, data = ToothGrowth)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.600 -3.700 0.373 2.116 8.800
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.2725 1.2824 7.231 1.31e-09 ***
## suppVC -3.7000 1.0936 -3.383 0.0013 **
## dose 9.7636 0.8768 11.135 6.31e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.236 on 57 degrees of freedom
## Multiple R-squared: 0.7038, Adjusted R-squared: 0.6934
## F-statistic: 67.72 on 2 and 57 DF, p-value: 8.716e-16
Explanation
library(stargazer)
stargazer(m1, m2, type = "html")
Dependent variable: | ||
len | ||
(1) | (2) | |
suppVC | -3.700*** | |
(1.094) | ||
dose | 9.764*** | 9.764*** |
(0.953) | (0.877) | |
Constant | 7.423*** | 9.272*** |
(1.260) | (1.282) | |
Observations | 60 | 60 |
R2 | 0.644 | 0.704 |
Adjusted R2 | 0.638 | 0.693 |
Residual Std. Error | 4.601 (df = 58) | 4.236 (df = 57) |
F Statistic | 105.065*** (df = 1; 58) | 67.718*** (df = 2; 57) |
Note: | p<0.1; p<0.05; p<0.01 |