Laden Sie den Datensatz mtcars aus dieser Quelle.
Berechnen Sie eine Regression mit mpg als Ausgabevariable und hp als Eingabevariable!
Welche Aussage ist für diese Analyse richtig?
-
mpgundhpsind positiv korreliert laut dem Modell. - Der Achsenabschnitt ist nahe Null.
- Die Analyse beinhaltet einen nominal skalierten Prädiktor.
- Das geschätzte Betagewicht für
hpliegt bei30.099. - Das geschätzte Betagewicht für
hpliegt bei-0.068.
TippLösung
Das geschätzte Betagewicht für hp liegt bei -0.068.
Die Analyse könnte so aussehen:
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.2.1 ✔ readr 2.2.0
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.3 ✔ tibble 3.3.1
## ✔ lubridate 1.9.5 ✔ tidyr 1.3.2
## ✔ purrr 1.2.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(easystats)
## # Attaching packages: easystats 0.7.5 (red = needs update)
## ✖ bayestestR 0.17.0 ✔ correlation 0.8.8
## ✖ datawizard 1.3.1 ✖ effectsize 1.0.2
## ✖ insight 1.5.1 ✖ modelbased 0.15.0
## ✖ performance 0.16.0 ✖ parameters 0.29.0
## ✔ report 0.6.4 ✖ see 0.13.0
##
## Restart the R-Session and update packages with `easystats::easystats_update()`.
mtcars <- read_csv("https://vincentarelbundock.github.io/Rdatasets/csv/datasets/mtcars.csv")
## Rows: 32 Columns: 12
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): rownames
## dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
lm1 <- lm(mpg ~ hp, data = mtcars)
parameters(lm1)
## Parameter | Coefficient | SE | 95% CI | t(30) | p
## ------------------------------------------------------------------
## (Intercept) | 30.10 | 1.63 | [26.76, 33.44] | 18.42 | < .001
## hp | -0.07 | 0.01 | [-0.09, -0.05] | -6.74 | < .001
##
## Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed
## using a Wald t-distribution approximation.Aufgabenname: lm1
- Falsch
- Falsch
- Falsch
- Falsch
- Richtig