Suppose I have two methods that I test over time on the same data. I suspect that the methods degrade over time, and that this degradation is more or less linear. I want to know if one method degrades faster than the other.
So, what I do is, I fit a line through both sets of data points with ordinary least squares (OLS) and I can do a z-test on the two slope coefficients β1 and β2 (see e.g. this post):
$$ z = \frac{\beta_1 - \beta_2}{\sqrt{SE(\beta_1)^2 + SE(\beta_2)^2}} $$
Now suppose I have heteroscedastic data, e.g. because I have far more data points in some time periods than in others. I shouldn't use OLS in that case, but weighted least squares (WLS).
Now my question is: can I still use the same z-test? So using on the coefficients and the SE's I get from the WLS fit?