Fits a spline and computes a simultaneous confidence interval.
Technical details
Description
See this blog article for other ways to create smoothing lines in visualizations and charts.
Inputs
- Outcome The outcome variable. A Numeric structure variable.
- Predictor The predictor variable. A Date/Time structure variable.
- Regression type Whether to fine a spline with a linear or logit link function. The default is Binary Logit.
- Confidence level (%) Controls width of the confidence interval around the spline. The default is 95.
- Draws to show Number of possible trend lines to super-impose. The default is 30.
- Weight Where a weight has been set for the R Output, a new data set is generated via resampling, and this new data set is used in the estimation.
- Filter The data is automatically filtered using any filters prior to estimating the model.
- Seed Initialize the randomization used in the algorithm. Different values will cause slight changes in the draws shown and confidence interval. The default is 12321
Output
Acknowledgements
This code is adapted from <https://www.fromthebottomoftheheap.net/2016/12/15/simultaneous-interval-revisited/ a post by Gavin Simpson>.
Method
- In Displayr: How to do a Spline-with-Simultaneous-Confidence-Interval
- In Q: Create > Test > Variance > Spline with Simultaneous Confidence Interval