How to calculate 95% confidence interval using regression analysis?
Show older comments
I have a timeseries dataset of measured lengths of some lines. The dataset consists of dates from oct of one year to march of next year. How do I calculate the 95% confidence interval values using regression analysis for each season (e.g. oct 2003 to March 2004 and so on). Something like this as shown below (CI = 95% confidence interval).

2 Comments
dpb
on 24 Feb 2023
Which toolboxes do you have available? regress in the Statistics TB returns the coefficients and the 95% CI (upper and lower) for each. The table above would use (one presumes) half the difference if the values presented are to be interpreted as "Rate +/- CI".
Alternatively, fit in the Curve Fitting TB has the same statistics and doesn't need the manual insertion of the column of ones to estimate the intercept term if needed.
The easiest way to do this will be to put your data into a timetable and create a grouping variable for the seasons by year; your selection from Oct to March (Is this inclusive or exclusive of March?) isn't a built in grouping so you'll have to create it.
Anwesha Sharma
on 24 Feb 2023
Accepted Answer
More Answers (0)
Categories
Find more on Descriptive Statistics and Insights in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!