I have about 20 years of data, each year has a number of observations. If I put a linear trend through the data, I get a trend, and this trend differs based on the the choice of start and end year, which to some extent feels arbitrary. Is there an established method to estimate time trends for data like these where you might sample some years, estimate a trend, resample etc to come up with a distribution for the trend, and thus provide some confidence interval for the trend?
I see moving window regression might be an option, but what would guide the choice of window? And how would you integrate all the results to make some inference about the trend.
Bootstrapping might be an option. What would be a principled way to approach the sampling?