Regression Analysis with Local Polynomial Regression Model - loess

Luca Vignali

How to Apply loess to your data

  • In this App, we apply Local Ploynomial Regression Analysis (loess)to your selected data set.
  • Select Predictor and Outcome in the Select Variables page.
  • Have a look at the prediction and adjust your level of confidence in the Prediction Page.

Select your File and Variables

  • In the Select variables page first Select your file. it must be .csv, with header and maximum 1Mbyte size. You can download the mtcars.csv if you don't have any .cvs file ready.
  • Once you have uploaded it, you can see your data in a tabular format in the same page.
  • Before running the model, select the Predictor and the Outcome typing the column name in the appropriate box.
  • Finally push the Enter button and move to the Prediction Page.

View your Data and Prediction Outcome

  • In the Prediction Page you can see two graphs: plot of your data and prediction and the Residual plot.
  • In the uppermost picture you can see your data, the predicted values in red and the grey prediction area that is tuned based on the Level of Confidence value you can select or input.
  • Below, you can see the Residuals plot to have a sense of the heteroscedasticity of the Outcome.
  • An example of the output is provided in the next slide.

Example from mtcars data set

  • Just for example, please have a look at the Outcome in the case we want to predict Miles per Gallon from Horse Power, values from the mtcars data set in R. The level of confidence is set to 0.95.

plot of chunk unnamed-chunk-1

Sesta slide

Your Reproducible Pitch Presentation

OK, you've made your shiny app, now it's time to make your pitch. You get 5 slides (inclusive of the title slide) to pitch a your app. You're going to create a web page using Slidify or Rstudio Presenter with an html5 slide deck.

Here's what you need

5 slides to pitch our idea done in Slidify or Rstudio Presenter Your presentation pushed to github or Rpubs A link to your github or Rpubs presentation pasted into the text box below Your presentation must satisfy the following

It must be done in Slidify or Rstudio Presenter It must be 5 pages It must be hosted on github or Rpubs It must contained some embedded R code that gets run when slidifying the document

Notice to publish your slidify presentation to github or Rpubs, there's the publish command. This link outlines how to do it (it's one line).

http://slidify.org/publish.html

Rstudio presenter has a button to publish directly to Rpubs https://support.rstudio.com/hc/en-us/articles/200714023-Displaying-and-Distributing-Presentations. If you are using Rpubs, put in the link to the presentation into the submission box as a http:// link not a https:// link.

You can also publish using both formats to github manually using gh-pages, though your github branch must have a .nojekyll fle and be on a branch names gh-pages. There's more on gh-pages here https://pages.github.com/ and there is a video lecture outlining how to do this.

Was the presentation completed in slidify or R Presenter?

Was it 5 pages?

Did it contain an R expression that got evaluated and displayed?

Was it hosted on github or Rpubs?

Was the presentation actually a presentation? (I.e. it had a legitimate pitch for the shiny application?)

Here's your opportunity to give this presentation a +1 for being well done. Did they tinker around with the default style? Was the presentation particularly lucid and well organized? In other words, the student made a legitimate try.

There were no R errors displayed in the presentation.

For more details on authoring R presentations click the Help button on the toolbar.

  • Bullet 1
  • Bullet 2
  • Bullet 3

Slide With Code

summary(cars)
     speed           dist       
 Min.   : 4.0   Min.   :  2.00  
 1st Qu.:12.0   1st Qu.: 26.00  
 Median :15.0   Median : 36.00  
 Mean   :15.4   Mean   : 42.98  
 3rd Qu.:19.0   3rd Qu.: 56.00  
 Max.   :25.0   Max.   :120.00  

Slide With Plot

plot of chunk unnamed-chunk-3