binb/inst/rmarkdown/templates/iqss/skeleton/skeleton.Rmd

204 lines
5.3 KiB
Plaintext

---
author: Ista Zahn and Gary King
classoption: compress
fontsize: 12pt
title: IQSS Beamer Class Demonstration
date: \today
institute: IQSS
output: binb::iqss
---
# Beamer Features
## Some of Gary's Examples
### What's this course about?
- \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
### 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 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.
# RMarkdown Examples
### R Figure
The following code generates the plot on the next slide (taken from
`help(bxp)` and modified slightly):
```{r pressureCode, eval=FALSE}
library(stats)
set.seed(753)
bx.p <- boxplot(split(rt(100, 4),
gl(5, 20)), plot=FALSE)
bxp(bx.p, notch = FALSE, boxfill = "lightblue",
frame = FALSE, outl = TRUE,
main = "Example from help(bxp)")
```
### R Figure
```{r pressureFig, echo=FALSE}
library(stats)
set.seed(753)
bx.p <- boxplot(split(rt(100, 4),
gl(5, 20)), plot=FALSE)
bxp(bx.p, notch = FALSE, boxfill = "lightblue",
frame = FALSE, outl = TRUE,
main = "Example from help(bxp)")
```
### R Table
A simple `knitr::kable` example:
\small
```{r kableEx}
knitr::kable(mtcars[1:5, 1:8],
caption="(Parts of) the mtcars dataset")
```
### Resources
#### For more information:
- See the [IQSS repository](https://github.com/IQSS/iqss-beamer-theme) for more on the IQSS them
- See the [RMarkdown repository](https://github.com/rstudio/rmarkdown) for more on RMarkdown
- See the [binb repository](https://github.com/eddelbuettel/binb) for more on binb
- See the [binb vignettes](https://github.com/eddelbuettel/binb/vignettes) for more examples.