1
0
mirror of https://github.com/eddelbuettel/binb synced 2024-12-23 04:59:58 +01:00
binb/inst/iqssDemo/iqssDemo.Rmd

249 lines
5.8 KiB
Plaintext
Raw Normal View History

---
author: Ista Zahn and Gary King
classoption: compress
fontsize: 12pt
title: IQSS Beamer Class Demonstration
date: \today
institute: IQSS
output: binb::iqss
vignette: >
%\VignetteIndexEntry{binb IQSS Demo}
%\VignetteKeywords{binb,vignette}
%\VignettePackage{binb}
%\VignetteEngine{knitr::rmarkdown}
---
# Beamer Features
## Some of Gary's Examples
### What's this course about?
::: incremental
- \alert{Specific statistical methods for many research problems}
- How to learn (or create) new methods
- Inference: \underline{Using facts you know to learn about
facts you don't know}
- \alert{How to write a publishable scholarly paper}
- \alert{All the practical tools of research} --- theory,
applications, simulation, programming, word processing, plumbing,
whatever is useful
- $\leadsto$ \alert{Outline and class materials:}
- \mbox{{\huge\parbox[b][.5in][t]{1in}{\alert{j.mp/G2001}}}
$\qquad\qquad$\includegraphics[width=.95in]{figs/phbAr.png}}
- The syllabus gives topics, not a weekly plan.
- We will go as fast as possible subject to everyone following along
- We cover different amounts of material each week
:::
### How much math will you scare us with?
- All math requires two parts: \alertb{proof} and \alertb{concepts \& intuition}
- Different classes emphasize:
- \alert{Baby Stats}: dumbed down proofs, vague intuition
- \alert{Math Stats}: rigorous mathematical proofs
- \alert{\underline{Practical Stats}}: deep concepts and intuition, proofs when needed
- Goal: how to do empirical research, in depth
- Use rigorous statistical theory --- when needed
- Insure we understand the intuition --- always
- Always traverse from theoretical foundations to practical applications
- Includes ``how to'' computation
- $\leadsto$ Fewer proofs, more concepts, better practical knowledge
- Do you have the background for this class?
. . .
\alert{A Test: What's this?
\begin{align*}
b=(X'X)^{-1}X'y
\end{align*} }
### Systematic Components: Examples
\includegraphics[width=8cm]{figs/functionalForms}
- \alertb{$E(Y_i) \equiv \mu_i = X_i\beta = \beta_0 +
\beta_1X_{1i} +\dots+\beta_kX_{ki}$}
- \alertc{$\Pr(Y_i=1) \equiv \pi_i =
\frac{1}{1+e^{-x_i\beta}}$}
- \alertd{$V(Y_i)\equiv \sigma_i^2 = e^{x_i\beta}$}
- Interpretation:
- Each is a \alert{class of functional forms}
- Set $\beta$ and it picks out one \alert{member of the class}
- \alert{$\beta$} in each is an ``effect parameter'' vector,
with different meaning
### Negative Binomial Derivation
\uncover<+->{Recall:}
\begin{equation*}
\uncover<+->{\Pr(A|B)=\frac{\Pr(AB)}{\Pr(B)} \implies
\alertb{\Pr(AB)}=\alerte{\Pr(A|B)}\alertd{\Pr(B)}}
\end{equation*}
\alertb<1-1>{one}
\alertc<2-2>{two}
\alertd<3-3>{three}
\begin{align*}
\uncover<+->{\text{NegBin}(y|\phi,\sigma^2) &= \int_0^\infty
\alerte{\text{Poisson}(y|\lambda)}
\times\alertd{\text{gamma}(\lambda|\phi,\sigma^2)}d\lambda\\}
\uncover<+->{&= \int_0^\infty
\alertb{\P(y,\lambda|\phi,\sigma^2) }d\lambda\\}
\uncover<+->{&=
\frac{\Gamma\left(\frac{\phi}{\sigma^2-1}+y_i\right)}
{y_i!\Gamma\left(\frac{\phi}{\sigma^2-1}\right)}
\left(\frac{\sigma^2-1}{\sigma^2}\right)^{y_i}
\left(\sigma^2\right)^{\frac{-\phi}{\sigma^2-1}}}
\end{align*}
# Other Features
## Structural Features
### Structural Features
#### Levels of Structure
- usual \LaTeX\ \textbackslash\ section, \textbackslash\ subsection commands
- `frame` environments provide slides
- `block` environments divide slides into logical sections
- `columns` environments divide slides vertically (example later)
- overlays (\`a la prosper) change content of slides dynamically
#### \alertc{Overlay Alerts}
On the first overlay, \alert<1>{this text} is highlighted (or \emph{alerted}).
On the second, \alert<2>{this text} is.
### Code blocks
\footnotesize
```r
# Say hello in R
hello <- function(name) paste("hello", name)
```
. . .
```python
# Say hello in Python
def hello(name):
return("Hello" + " " + name)
```
. . .
```haskell
-- Say hello in Haskell
hello name = "Hello" ++ " " ++ name
```
. . .
```c
/* Say hello in C */
#include <stdio.h>
int main()
{
char name[256];
fgets(name, sizeof(name), stdin);
printf("Hello %s", name);
return(0);
}
```
\normalsize
### Alerts
- First level \alert{alert}
- Second level \alertb{alert}
- Third level \alertc{alert}
- Fourth level \alertd{alert}
- Fifth level \alerte{alert}
# More Features
## Blocks
### Other Features
#### Levels of Structure
- Clean, extensively customizable visual style
- Hyperlinks ([http://github.com/izahn/iqss-beamer-theme](click here_)
- No weird scaling prosper
- slides are 96~mm~$\times$~128~mm
- text is 10-12pt on slide
- slide itself magnified with Adobe Reader/xpdf/gv to fill screen
- pgf graphics framework easy to use
- include external JPEG/PNG/PDF figures
- output directly to pdf: no PostScript hurdles
- detailed User's Manual (with good presentation advice, too)
### Theorems and Proofs
\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
#### Theorem
There is no largest prime number.
#### Proof
> - Suppose $p$ were the largest prime number.
> - Let $q$ be the product of the first $p$ numbers.
> - Then $q+1$ is not divisible by any of them.
> - But $q + 1$ is greater than $1$, thus divisible by some prime
number not in the first $p$ numbers. \qedhere
### Blocks
#### Normal block
A \alert{set} consists of elements.
#### \alert{Alert block}
$2=2$.
#### \alertc{Example block}
The set $\{1,2,3,5\}$ has four elements.
# Appendix
---
Backup Slides
<!-- \subsection{More stuff} -->
---
Details
---
Text omitted in main talk.
<!-- \subsection{Even more additional material} -->
---
More details
---
Even more details