sma
and ma
, which will fit SMA and MA respectively, and construct confidence intervals or test hypotheses about slope or elevation in one or several samples, depending on how the arguments are used.For example:
sma(y~x)
will fit a SMA for y
vs x
, and report confidence intervals for the slope and elevation.
sma(y~x, robust=T)
will fit a robust SMA for y
vs x
using Huber's M estimation, and will report (approximate) confidence intervals for the slope and elevation.
ma(y~x*groups-1)
will fit MA lines for y
vs x
that are forced through the origin, where a separate MA is fitted to each of several samples as specified by the argument groups
. It will also report results from a test of the hypothesis that the true MA slope is equal across all samples.
For more details, see the help listings for sma
and ma
.
Note that the sma
and ma
functions replace the functions given in earlier package versions as line.cis
, slope.test
, elev.test
, slope.com
, elev.com
and shift.com
, although all of these functions and their help entries are still available.
All procedures have the option of correcting for measurement error, although only in an approximate fashion, valid in large samples.
Additional features of this package are listed below.
Example datasets:
sma
and ma
functions.
For more details, see the documentation for any of the individual functions listed above.
Warton D. I., Wright I. J., Falster D. S. and Westoby M. (2006) A review of bivariate line-fitting methods for allometry. Biological Reviews 81, 259--291.
Taskinen S. and Warton D. I. (in press) Robust estimation and inference for bivariate line-fitting in allometry. Biometrical Journal.
sma
,ma
, meas.est
, leaflife
, leafmeas
# See ?sma and ?plot.sma for a full list of examples.
Run the code above in your browser using DataLab