From 2e87cc83a2966565178c5636783d7c02a33aa31d Mon Sep 17 00:00:00 2001 From: Ken Butler Date: Thu, 25 Jan 2024 11:47:45 -0500 Subject: [PATCH] edits --- choosing.qmd | 2 +- logistic.qmd | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/choosing.qmd b/choosing.qmd index c6ea647..4cea567 100644 --- a/choosing.qmd +++ b/choosing.qmd @@ -242,7 +242,7 @@ athletes %>% ## Summary of data selection/arrangement "verbs" {.smaller} | Verb | Purpose | -|:-----------------|:-----------------------------------------------------| +|:----------------|:------------------------------------------------------| | `select` | Choose columns | | `slice` | Choose rows by number | | `slice_sample` | Choose random rows | diff --git a/logistic.qmd b/logistic.qmd index 7136771..705053d 100644 --- a/logistic.qmd +++ b/logistic.qmd @@ -169,7 +169,7 @@ rat2.1 <- glm(response ~ dose, family = "binomial", data = rat2) summary(rat2.1) ``` -## Predicted survival probs +## Predicted survival probs ```{r bLogistic-13 } #| warning = FALSE @@ -400,6 +400,8 @@ For probability $p$, odds is $p/(1-p)$: - Recall prediction of probability of death from risk factors: ```{r bLogistic-20} +sepsis +summary(sepsis.2) sepsis.2.tidy <- tidy(sepsis.2) sepsis.2.tidy ``` @@ -540,6 +542,7 @@ miners miners %>% group_by(Exposure) %>% mutate(proportion = Freq / sum(Freq)) -> prop +prop ggplot(prop, aes(x = Exposure, y = proportion, colour = Severity)) + geom_point() + geom_smooth(se = F) @@ -622,7 +625,11 @@ cbind(predictions(sev.1, newdata = new)) %>% ```{r} plot_predictions(model = sev.1, condition = c("Exposure", "group"), - type = "probs") + + type = "probs") + +``` + +```{+} geom_point(data = prop, aes(x = Exposure, y = proportion, colour = Severity)) -> ggg ```