Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (44 sloc) 1.38 KB
---
title: 'Iris: Sepal-Ratio Modeling'
author: "Bastiaan Quast"
date: "Thursday, July 18, 2014"
output:
ioslides_presentation:
keep_md: yes
transition: faster
---
# We want to model sepal ratios, do we need separate models for each species?
## Iris dataset
- Included in R package **datasets**
- Originally by Fisher or Anderson
- Measurements for **petal** and **sepal** width and length
- Fifty flowers of three species
- Setosa
- Versicolor
- Virginica
```{r}
str(iris)
```
## LOESS Model
- **Lo**cally W**e**ighted **S**catterplot **S**moothing
- [more info on LOESS](http://en.wikipedia.org/wiki/Local_regression)
- General model and species-specific models
- Standard Error bands
- Grey band for general model
- Coloured bands for respective species
- Adjustable 'wobblyness' of models
- Adjustable point size and opacity
## Results
```{r, echo = FALSE, message = FALSE, fig.width = 6, fig.height = 4}
library(ggvis)
iris %>%
ggvis(~Sepal.Width, ~Sepal.Length) %>%
layer_smooths(span = 0.75, se = TRUE) %>%
group_by(Species) %>%
layer_points(size := 50, opacity := 0.5, fill = ~Species) %>%
layer_smooths(span = 0.75, fill = ~Species, se=TRUE) %>%
add_axis("x", title = "Sepal Width") %>%
add_axis("y", title = "Sepal Length")
```
An interactive version of this plot is available here:
https://bquast.shinyapps.io/Iris-Presentation