#< ignore

```{r "create_ps",include=FALSE , eval=!TRUE}
library(RTutor)
# Set to your working directory
setwd("C:/libraries/RTutor/RTutor/inst/examples")
ps.name = "VisualMode"; sol.file = paste0(ps.name,"_sol.Rmd")
libs = c("dplyr") 
create.ps(sol.file=sol.file, ps.name=ps.name, libs=libs)
stop()
```

#>

## Exercise 1

This problem set is designed to be solved in RStudio's new [Visual Mode](https://rstudio.github.io/visual-markdown-editing). The solution file should be kept in the default source mode, since some RTutor syntax, like the start of a block with `#<` will be rewritten in visual mode. In the visual mode, HTML links, images and Latex fomulas will be nicely displayed. Let us look at an example...

Consider the following simulated code:
```{r}
#< task_notest
n = 1000
eps = rnorm(n,0,1)
x2 = rnorm(n,0,1)
x1 = rnorm(n,0,1) +x2
beta0 = 100; beta1 = 0; beta2 = 1;
y = beta0+beta1*x1+beta2*x2+eps
#>
```

Estimate the following **short regression**:

$$y = \beta_0 + \beta_1 x_1 + u$$
```{r}
#< fill_in
# Complete the code
lm(___)
#>
lm(y~x1)
```
#< award "Your first regression"
Great, you have run your first regression...
#>

What do we learn?

<img src="https://imgs.xkcd.com/comics/correlation.png" title="Correlation doesn't imply causation, but it does waggle its eyebrows suggestively and gesture furtively while mouthing 'look over there'.">

(Source: [xkcd](https://xkcd.com/552/))

