Calculates a Wald statistic to test for no shift along several MA's or SMA's of common slope. This is done by testing for equal fitted axis means 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
- fitted axis 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 residuals against fitted axis scores, and by constructing a Q-Q plot of residuals against a normal distribution. An appropriate residual variable is 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 fitted axis scores systematically differ across groups then this is evidence of a shift along the common axis.
The common slope ($\hat{\beta}$) is estimated from a maximum of 100 iterations, convergence is reached when the change in $\hat{\beta}$ is $< 10^{-6}$.