In a shiny app I developed, I'm fitting a number of Loess curves over the ozone datset (temperature vs ozone levels [ppm]). See Link.

I wonder why the Loess fits (and the associated average over all fits, the red line) do not extend over all datapoints.

I believe I'm setting up the fit such that for every data point a prediction is to be made (see line 23 in the code).

In my local version of the app, the fit -at least visually- is over all datapoints. enter image description here

  • $\begingroup$ I don't think I'm following. How are you using the word "over". The loess fits seems to extend over the entire range of your data. $\endgroup$ May 15, 2015 at 14:29
  • $\begingroup$ Isn't ozone more nearly a response to temperature rather than vice versa? $\endgroup$
    – Nick Cox
    May 15, 2015 at 14:31
  • $\begingroup$ @MatthewDrury In the screenshot yes, but that's from my local app- not from the shiny app. That's the discrepancy I'm pointing at. $\endgroup$
    – TMOTTM
    May 15, 2015 at 16:30
  • $\begingroup$ @NickCox I'm merely reproducing an example from a slideshow. The physical nature doesn't matter that much in this exercise. $\endgroup$
    – TMOTTM
    May 15, 2015 at 16:31


Browse other questions tagged or ask your own question.