Part 4 - Inference (2)
# Linear Regression Model
lm_lx <- lm(docs_per_k ~ log(gdp_per_capita), data = df)
summary(lm_lx)
##
## Call:
## lm(formula = docs_per_k ~ log(gdp_per_capita), data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.8556 -0.7507 -0.3191 0.4433 6.4841
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.78415 0.10035 -27.74 <0.0000000000000002 ***
## log(gdp_per_capita) 0.50995 0.01148 44.43 <0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.112 on 4000 degrees of freedom
## Multiple R-squared: 0.3305, Adjusted R-squared: 0.3303
## F-statistic: 1974 on 1 and 4000 DF, p-value: < 0.00000000000000022
The \(R^2\) value is now .33, which is an improvement over the last model, but only a third of the variance is accounted for by this model.