---
title: "Data Scientism Poster: Random Causal Impacts"
output:
  flexdashboard::flex_dashboard:
    orientation: rows
    source: embed
    social: menu
---




## Row 1 {data-height=15}
 **Abstract:** 
Template for academic poster preparation with R markdown.

* Crammed and complex posters are bad
* Remember: estimate, don't testimate

## Row 2 {data-height=80}

### **Methods**

This poster template depends on the following R packages

```{r, echo=T}
library(flexdashboard)
library(stargazer)
```

To make this poster template,
```{r, echo=T, eval=F}
rmarkdown::render('DataScientism_Poster.Rmd')
```

```{r, echo=F, eval=F}
## Load prepared data
load('YourData.Rdata')
```

```{r, echo=F}
## Making Random Data For This Template
n <- 1000
n_index <- seq(n)

set.seed(1)
random_walk1 <- cumsum(runif(n,-1,1))

## Let the data take shape
## (around the large differences before and after)
n1 <- 290
wind1 <- c(n1-300,n1+300)
dat1 <- data.frame(t=n_index, y=random_walk1, d=1*(n_index > n1))
dat1_sub <- dat1[ n_index>wind1[1] & n_index < wind1[2],]
```

### **Main Result** (Figure Preferred)

```{r, eval=F, echo=F}
## Figures can be read in
knitr::include_graphics('../folder/picture.pdf')
```

Here is an RDD applied to a random walk

```{r, message=F, warning=F, out.width="100%"}
## Produce nice figure
reg0 <- lm(y~t, data=dat1_sub[dat1_sub$d==0,])
reg1 <- lm(y~t, data=dat1_sub[dat1_sub$d==1,])

plot(random_walk1, pch=16, col=rgb(0,0,1,.25), xlim=wind1)
abline(v=n1, lty=2)
lines(reg0$model$t, reg0$fitted.values, col=1)
lines(reg1$model$t, reg1$fitted.values, col=1)
```


### **Discussion**

Potential Secondary Result

```{r, message=F, warning=F, results='asis', out.width="100%", eval=T}
rdd_sub <- lm(y~d+t+d*t, data=dat1_sub)
#rdd_full <- lm(y~d+t+d*t, data=dat1)
stargazer::stargazer(rdd_sub, 
    type='html', table.placement='h!', title='Recipe RDD',
    header=F, omit=c('Constant'),
    dep.var.labels.include=F, column.labels='', dep.var.caption='',
    no.space=T, omit.stat='all')
```

```{r, eval=F, echo=F}
library(kableExtra)
t(summary(dat1_sub)) %>% kbl() %>%  kable_styling()
```

## Row 3 {data-height=5, .small}

### **Contact:**
Name. email@address. Institution.
  

### **References:**

* https://pkgs.rstudio.com/flexdashboard/articles/examples.html
* https://pagedown.rbind.io/poster-jacobs


<!-- ## COMPILE FROM CLI
    Rscript -e "rmarkdown::render('DataScientism_Poster.Rmd')"
    cp DataScientism_Poster.html DataScientism_Poster.Rmd ../docs/Templates
    
    ## Convert to PDF
    pandoc DataScientism_Poster.html -t latex -o DataScientism_Poster.pdf
    Rscript -e "pagedown::chrome_print('DataScientism_Poster.html')"
--->    


