Solved – How to compare loess models from related datasets

loessr

I'm comparing matched data from a series of patients, looking at the effect of mental stress on cardiac conduction. I'm using the loess function to visually describe my data, and have 2 curves: one for with and one for without mental stress. I'd like to compare these curves.

Is it possible to compare two loess models from different (thought related) datasets. Alternatively, could I code +/- mental stress with 1/0 and use that to get a statistical relationship between the two models?

Any pointers would be super-appreciated.

Best Answer

Unfortunately loess fits are not comparable. A loess (or lowess) curve is not like one based on a linear or quadratic or cubic equation. I know of no statistial package that will provide an equation that defines a loess curve, nor a fit statistic such as R-squared for it. Such a curve is completely opportunistic and therefore unique to each dataset. A loess fit is atheoretical; one would not want to use it to try to formally replicate a pattern across datasets. You might say it's "for exploratory purposes only," and even there one must use care, as you can see if you read through threads such as this one.