< ignore

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. 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:

#< 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$$

#< fill_in
# Complete the code
lm(___)
#>
lm(y~x1)

< award "Your first regression"

Great, you have run your first regression...

>

What do we learn?

(Source: xkcd)



skranz/RTutor documentation built on Feb. 7, 2024, 12:53 a.m.