Skip to content

Instantly share code, notes, and snippets.

@MilesMcBain
Created August 10, 2016 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MilesMcBain/7767cc9d8ee8869d715243bd9fd7ee36 to your computer and use it in GitHub Desktop.
Save MilesMcBain/7767cc9d8ee8869d715243bd9fd7ee36 to your computer and use it in GitHub Desktop.
---
title: "Plotly Slideshow Example"
author: "Miles McBain"
date: "6 August 2016"
output:
ioslides_presentation
---
```{r, include=FALSE}
library(AER)
library(ggplot2)
library(dplyr)
library(plotly)
```
#Welcome
Example Deck
##Count data | Fixed Exposure
* **Exposure** refers to length of the observation interval in time/space/clicks/views/customers etc..
* Fixed exposure means it is the same for each observation
* Example data: [Number of tropical cyclones in Australian Region by year](http://www.bom.gov.au/cyclone/climatology/trends.shtml)
$$Y_{i} \sim Pois(\lambda_{i})$$
$$\mu_{i} = \lambda_{i}$$
$$g(\mu_{i}) = \eta_i$$
for $g(.) = log(.)$ (canonical): $\mu_{i} = \exp(\eta_i)$
##Count data | Variable Exposure
* Variable exposure means we have some observation interval measure associated with each $y_{i}$
+ $n_{i}$, $t_{i}$... etc
* Example data: `AER::ShipAccidents` (next slide)
##Shipping Accidents
```{r, echo=FALSE}
data("ShipAccidents")
p <- ShipAccidents %>%
ggplot(aes(x=service, y=incidents, construction=construction)) +
xlab("service (months)") +
geom_point(aes(colour=type))
ggplotly(p)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment