Calculates a Wald statistic to test for equal elevation of several MA's or SMA's with a common slope. This is done by testing for equal mean residual scores across groups. Note that this test is only valid if it is reasonable to assume that the axes for the different groups all have the same slope.
The test assumes the following:
- each group of observations was independently sampled
- the axes fitted to all groups have a common slope
- y and x are linearly related within each group
- residual scores independently follow a normal distribution with equal variance at all points along the line, within each group
Note that we do not need to assume equal variance across groups, unlike in tests comparing several linear regression lines. The assumptions can be visually checked by plotting residual scores against fitted axis scores, and by constructing a Q-Q plot of residuals against a normal distribution. Residual scores can be obtained as y-bx, and for fitted axis scores y+bx (for SMA) or by+lx (for MA or `lamest'), where b represents the common slope estimate, and l the error variance ratio. If there is a distinct increasing or decreasing trend within any of the groups, this suggests that all groups do not share a common slope.
A plot of residual scores against fitted axis scores can also be used as a visual test for common elevation. If residual scores generally differ across groups (with some groups generally having larger residual scores than others) then this is evidence that the groups do not share a common elevation.
The common slope ($\hat{\beta}$) is estimated from a maximum of 100 iterations, convergence is reached when the change in $\hat{\beta} < 10^{-6}$.