Blog
r programming 101
Q1:The linear regression results below display the effect of six indices that might affect happiness across different regions in the world: economic production, social support, life expectancy, freedom, absence of corruption, and generosity. The data question is:
What affects happiness?
Based on the output below, how can we answer the question above?
##
## Call:
## lm(formula = ladder_score ~ logged_gdp_per_capita social_support
## healthy_life_expectancy freedom_to_make_life_choices
## generosity perceptions_of_corruption, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.85049 -0.30026 0.05735 0.33368 1.04878
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.23722 0.63049 -3.548 0.000526 ***
## logged_gdp_per_capita 0.27953 0.08684 3.219 0.001595 **
## social_support 2.47621 0.66822 3.706 0.000301 ***
## healthy_life_expectancy 0.03031 0.01333 2.274 0.024494 *
## freedom_to_make_life_choices 2.01046 0.49480 4.063 7.98e-05 ***
## generosity 0.36438 0.32121 1.134 0.258541
## perceptions_of_corruption -0.60509 0.29051 -2.083 0.039058 *
## —
## Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ‘ 1
##
## Residual standard error: 0.5417 on 142 degrees of freedom
## Multiple R-squared: 0.7558, Adjusted R-squared: 0.7455
## F-statistic: 73.27 on 6 and 142 DF, p-value: < 2.2e-16
question2 see attached file