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, available using
plot.sma(sma.object,which="residual")
.
On a residual plot, 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 no shift. If fitted axis scores systematically differ across groups then this is evidence of a shift along the common axis.
Setting robust=TRUE
fits lines using Huber's M estimation, and modifies the test statistic as proposed in Taskinen & Warton (in review).
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}\).