This peer assessed assignment has two parts. First, you will create a Shiny application and deploy it on Rstudio's servers. Second, you will use Slidify or Rstudio Presenter to prepare a reproducible pitch presentation about your application.
16 September 2017
This peer assessed assignment has two parts. First, you will create a Shiny application and deploy it on Rstudio's servers. Second, you will use Slidify or Rstudio Presenter to prepare a reproducible pitch presentation about your application.
Description
This application allows you to generate a 3 polynomial model with a customizable sample size You can then plot a simple regression line or a more complex line going up to 10 degrees The aim of this app is to show the effect of complex polynomial and data size on overfitting
n <- 20
x <- sort(runif(n, -2, 2))
y <- 3*x^3 + 5*x^2 + 0.5*x + 20 # a 3 polynomial model
err <- rnorm(n, sd=3)
ye <- y + err
df <- data.frame(x, ye)
p<-ggplot(df, aes(x, ye)) +
geom_point(alpha=2/10, shape=21, fill="blue",
colour="black", size=5)+
stat_smooth(method="lm", se=TRUE, fill=NA,
formula=y ~ poly(x, 3, raw=TRUE),colour="red")