The plot.sma
function produces one of three different types of plot, depending on the which
argument.
The default plot, which="default"
, produced a plot of y
vs x
, with separate symbols for each group
if appropriate, and MA or SMA lines fitted through each group. The formula used in the sma
object that is input to the plot
function determines whether there is a group structure, whether fitted lines have common slope, etc.
A residual plot can be obtained via which="residual"
- this is a plot of residuals against fitted values. This can be used to check assumptions - if assumptions are satisfied there should be no pattern.
A normal quantile plot can be obtained via which="qq"
- this is a normal quantile plot of residuals. This can be used to check the normality assumption - if data are close to a straight line, normality is plausible. Note that non-normality is only important to the validity of the test in small samples. In larger samples, non-normality will not effect validity, but strong non-normality will reduce the power of tests.
If use.null=TRUE
then the lines added to the plot use the coefficients estimated under the null hypothesis. For example, if the sma object x
was produced using a common slopes test (via y~x*groups
or similar) then use.null=TRUE
will plot lines that apply the common slope to each group.
The arguments pch
, col
, lty
, from & to
, are used to modify characteristics of the plotted points and lines. If a vector of values for anyone of these arguments is passed to plot.sma
, then successive values are applied to each group, provided group structure is included in x
and the vector length is at least as long as the number of groups.
By default, plot.sma
uses the default tick spacing given by plot.default
. To customise axes, users can pass special axis objects to plot.sma
, obtained using the defineAxis
command as in the example below. This enables high quality publishable plots to be produced. See plotutils
for more information.