Lineair regressiemodel

Oefenen met statistiek-vragen voor sollicitaties in R

Zuzanna Chmielewska

Actuary

Lineair regressiemodel

fruit

Oefenen met statistiek-vragen voor sollicitaties in R

Lineair regressiemodel

een huizenprijs

Oefenen met statistiek-vragen voor sollicitaties in R

datapunten met een positieve lineaire correlatie

Oefenen met statistiek-vragen voor sollicitaties in R

datapunten met een positieve lineaire correlatie

Oefenen met statistiek-vragen voor sollicitaties in R

Lineair regressiemodel

$$ y_i = \beta_0 + \beta_1 \cdot x_{i1} + ... + \beta_p \cdot x_{ip} + e_{i}$$ waar:

  • $y_i$ - afhankelijke variabele,
  • $x_{ij}$ - onafhankelijke variabelen,
  • $\beta_{j}$ - parameters,
  • $e_i$ - fout.
Oefenen met statistiek-vragen voor sollicitaties in R

Lineaire voorspellingsfunctie

$$ \hat{y_i} = \beta_0 + \beta_1 \cdot x_{i1} + ... + \beta_p \cdot x_{ip}$$

Oefenen met statistiek-vragen voor sollicitaties in R

simpel lineair model $$ \hat{y_i} = \beta_0 + \beta_1 \cdot x_{i} $$

Oefenen met statistiek-vragen voor sollicitaties in R

simpel lineair model $$ \hat{y_i} = \beta_0 + \beta_1 \cdot x_{i} $$

Oefenen met statistiek-vragen voor sollicitaties in R

simpel lineair model $$ \hat{y_i} = \beta_0 + \beta_1 \cdot x_{i} $$

Oefenen met statistiek-vragen voor sollicitaties in R

simpel lineair model $$ \hat{y_i} = \beta_0 + \beta_1 \cdot x_{i} $$

Oefenen met statistiek-vragen voor sollicitaties in R

Log-transformatie

Voorbeelden: $$ \hat{y_i} = \beta_0 + \beta_1 \cdot ln(x_{i1}) + ... + \beta_p \cdot x_{ip}$$

$$ ln(\hat{y_i}) = \beta_0 + \beta_1 \cdot x_{i1} + ... + \beta_p \cdot x_{ip}$$

Oefenen met statistiek-vragen voor sollicitaties in R

Aannames

  • Lineair verband
  • Normaal verdeelde fouten
  • Homoscedastische fouten
  • Onafhankelijke observaties
Oefenen met statistiek-vragen voor sollicitaties in R

Lineair model in R

model <- lm(dist ~ speed, data = cars)

print(model)
Call:
lm(formula = dist ~ speed, data = cars)

Coefficients:
(Intercept)        speed  
    -17.579        3.932
Oefenen met statistiek-vragen voor sollicitaties in R

Lineair model in R

model <- lm(dist ~ speed, data = cars)
new_car <- data.frame(speed = 17.5)

predict(model, newdata = new_car)
       1 
51.23806
Oefenen met statistiek-vragen voor sollicitaties in R

Diagnostische plots

model <- lm(dist ~ speed, data = cars)
plot(model)

diagnostische plots lineair model

Oefenen met statistiek-vragen voor sollicitaties in R

diagnostische plot lineair model

Oefenen met statistiek-vragen voor sollicitaties in R

diagnostische plot lineair model

Oefenen met statistiek-vragen voor sollicitaties in R

diagnostische plot lineair model

Oefenen met statistiek-vragen voor sollicitaties in R

diagnostische plot lineair model

Oefenen met statistiek-vragen voor sollicitaties in R

Samenvatting

  • lineair regressiemodel
  • lineaire voorspellingsfunctie
  • lm() in R
  • diagnostische plots
Oefenen met statistiek-vragen voor sollicitaties in R

Laten we oefenen!

Oefenen met statistiek-vragen voor sollicitaties in R

Preparing Video For Download...