Skip to contents

Life satisfaction = theta0 + theta1 * GDP per capita (Geron Ch 1, morie.fn hmlrl)

Usage

morie_geron_linear_regression_life(gdp, theta0, theta1, life_sat = NULL)

Arguments

gdp

GDP per capita.

theta0, theta1

Intercept/slope.

life_sat

Optional observed values.

Value

List with prediction, residuals, rmse, r2, theta0, theta1, estimate, n, method.

Examples

morie_geron_linear_regression_life(gdp = c(1, 2, 3, 4, 5, 6, 7, 8),
  theta0 = c(1, 2, 3, 4, 5, 6, 7, 8), theta1 = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $prediction
#> [1]  2  6 12 20 30 42 56 72
#> 
#> $residuals
#> NULL
#> 
#> $rmse
#> NULL
#> 
#> $r2
#> NULL
#> 
#> $theta0
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $theta1
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $estimate
#> [1] 2
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Univariate linear model (life satisfaction vs GDP per capita)"
#>