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.
Answerlist
Falsch
Falsch
Falsch
Falsch
Richtig
Categories:
regression
lm
stats-nutshell
schoice
Source Code
---exname: lm1extype: schoiceexsolution: 1exshuffle: nocategories:- regression- lm- stats-nutshell- schoicedate: '2023-05-08'slug: lm1title: lm1---```{r data generation, echo = FALSE, results = "hide"}d <- data.frame(x = runif(100, -1, 1))a <- 0b <- sample(c(-1, 1), 1) * sample(c(0, 0.6, 0.9), 1)d$y <- a + b * d$x + rnorm(100, sd = 0.25)write.csv(d, "regression.csv", row.names = FALSE, quote = FALSE)m <- lm(y ~ x, data = d)bhat <- coef(m)[2]bpvl <- summary(m)$coefficients[2, 4]bsol <- c(bpvl >= 0.05, (bpvl < 0.05) & (bhat > 0), (bpvl < 0.05) & (bhat < 0))```# AufgabeLaden Sie den Datensatz `mtcars` aus [dieser Quelle](https://vincentarelbundock.github.io/Rdatasets/csv/datasets/mtcars.csv).Berechnen Sie eine Regression mit `mpg` als Ausgabevariable und `hp` als Eingabevariable!Welche Aussage ist für diese Analyse richtig?Answerlist----------* `mpg` und `hp` sind positiv korreliert laut dem Modell.* Der Achsenabschnitt ist nahe Null.* Die Analyse beinhaltet einen nominal skalierten Prädiktor.* Das geschätzte Betagewicht für `hp` liegt bei `30.099`.* Das geschätzte Betagewicht für `hp` liegt bei `-0.068`.</br></br></br></br></br></br></br></br></br></br># LösungDas geschätzte Betagewicht für `hp` liegt bei `-0.068`.Die Analyse könnte so aussehen:```{r echo = TRUE, warning=FALSE}library(tidyverse)library(easystats)mtcars <- read_csv("https://vincentarelbundock.github.io/Rdatasets/csv/datasets/mtcars.csv")lm1 <- lm(mpg ~ hp, data = mtcars)parameters(lm1) ```Answerlist----------* Falsch* Falsch* Falsch* Falsch* Richtig---Categories: - regression- lm- stats-nutshell- schoice