Skip to content

Commit

Permalink
1405 dplots binary
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanrongen committed Jun 14, 2024
1 parent 3f3e48e commit 88f53f1
Show file tree
Hide file tree
Showing 34 changed files with 215 additions and 245 deletions.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
377 changes: 174 additions & 203 deletions _site/materials/glm-practical-logistic-binary.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions _site/search.json

Large diffs are not rendered by default.

45 changes: 15 additions & 30 deletions materials/glm-practical-logistic-binary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,22 @@ exec(open('setup_files/setup.py').read())
## R

### Libraries

```{r}
#| eval: false
library(broom)
library(tidyverse)
library(ggResidpanel)
```

### Functions

```{r}
#| eval: false
# create diagnostic plots
ggResidpanel::resid_panel()
```

## Python

### Libraries
Expand Down Expand Up @@ -509,19 +523,6 @@ The graph shows us that, based on the data that we have and the model we used to

Short beaks are more closely associated with the bluntly shaped beaks, whereas long beaks are more closely associated with the pointed shape. It's also clear that there is a range of beak lengths (around 13 mm) where the probability of getting one shape or another is much more even.

<!-- ## Parameter estimation explained -->

<!-- Now that we know how to interpret the coefficients or parameters, let's have a look at how they're actually determined. To understand this, we need to take a step back. -->

<!-- * Sum of squares (OLS) -->
<!-- * MLE -->
<!-- * Deviance -->

<!-- ## Assumptions -->

<!-- * GAMLSS -->


## Assumptions

As explained in the background chapter, we can't really use the standard diagnostic plots to assess assumptions. We're not going to go into a lot of detail for now, but there is one thing that we can do: look for influential points using the Cook’s distance plot.
Expand All @@ -530,24 +531,8 @@ As explained in the background chapter, we can't really use the standard diagnos
## R

```{r}
plot(glm_bks , which = 4)
```

:::{.callout-note collapse=true}
## Extracting the Cook's distances from the `glm` object

Instead of using the `plot()` function, we can also extract the values directly from the `glm` object. We can use the `augment()` function to do this and create a lollipop or stem plot:

```{r}
glm_bks %>%
augment() %>% # get underlying data
select(.cooksd) %>% # select the Cook's d
mutate(obs = 1:n()) %>% # create an index column
ggplot(aes(x = obs, y = .cooksd)) +
geom_point() +
geom_segment(aes(x = obs, y = .cooksd, xend = obs, yend = 0))
resid_panel(glm_bks, plots = "cookd")
```
:::

## Python

Expand Down
14 changes: 14 additions & 0 deletions materials/glm-practical-logistic-proportion.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,22 @@ exec(open('setup_files/setup.py').read())
## R

### Libraries

```{r}
#| eval: false
library(broom)
library(tidyverse)
library(ggResidpanel)
```

### Functions

```{r}
#| eval: false
# create diagnostic plots
ggResidpanel::resid_panel()
```

## Python

### Libraries
Expand Down

0 comments on commit 88f53f1

Please sign in to comment.