Skip to content

Commit

Permalink
remove lm models (response does not follow gaussian distribution)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansvancalster committed Aug 26, 2024
1 parent 535acb0 commit 24b3fc2
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions source/data_analysis_spring_2023.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -783,30 +783,11 @@ flowers <- flowers |>
flowers |>
ggplot(aes(x = number_of_floral_units, y = n_species_ap)) +
geom_point() +
geom_smooth(method = "lm")
geom_smooth(method = "glm", method.args = list(family = "poisson")) +
scale_x_continuous(trans = "pseudo_log")
```

```{r}
model1 <- lm(n_ind_ap ~ number_of_floral_units, data = flowers |>
filter(number_of_floral_units < 4000))
summary(model1)
model2 <- lm(n_species_ap ~ number_of_floral_units, data = flowers |>
filter(number_of_floral_units < 4000))
summary(model2)
model3 <- lm(n_ind_syr ~ number_of_floral_units, data = flowers |>
filter(number_of_floral_units < 4000))
summary(model3)
model4 <- lm(n_species_syr ~ number_of_floral_units, data = flowers |>
filter(number_of_floral_units < 4000))
summary(model4)
```

Geen significant effect van het aantal bloemeenheden op het aantal soorten of het aantal gevangen individuen; het effect wordt nog minder significant wanneer één sterke uitschieter wordt verwijderd.

### Uitgebreid model
```{r}
flowers <- flowers |>
mutate(location_code = str_sub(sampling_site_cd, start = 1L, end = 8L),
Expand Down

0 comments on commit 24b3fc2

Please sign in to comment.