This is an Rmarkdown (.Rmd
) document, and you may be reading the HTML version (after its compilation). Please get the .Rmd
version in our website, in order to:
[CTRL+SHIFT+K]
.In case of errors, look for help or contact your instructor.
The following lines create a dataset in an independent variable called x
and a dependent variable called y
.
set.seed(123)
x = rnorm(n=100, mean=0, sd=0.5)
y = 4.1 - 1.3*x - 1.5*x^2 + rnorm(n=100, mean=0, sd=0.3)
m = data.frame(x=x, y=y)
Here I don’t ask you to pay attention to how the data has been generated.
# Code for plotting data (x,y)
# Code for adding points in red color to plot
Here your explanation.