Learn R Programming

smatr

(Standardised) Major Axis Estimation and Testing Routines

smatr is an R package for fitting (Standardised) Major Axis Lines to bivariate data. The package is described in the following publication:

Warton, David I., Duursma, Remko A., Falster, Daniel S. and Taskinen, Sara (2012) smatr 3 - an R package for estimation and inference about allometric lines. Methods in Ecology and Evolution, 3(2), 257-259. doi:10.1111/j.2041-210X.2011.00153.x.

Abstract:

1. The Standardised Major Axis Tests and Routines (SMATR) software provides tools for estimation and inference about allometric lines, currently widely used in ecology and evolution. 2. This paper describes some significant improvements to the functionality of the package, now available on R in smatr version 3. 3. New inclusions in the package include sma and ma functions that accept formula input and perform the key inference tasks; multiple comparisons; graphical methods for visualising data and checking (S)MA assumptions; robust (S)MA estimation and inference tools.

The package was programmed by David Warton, Remko Duursma and Daniel Falster, and is maintained by Daniel Falster.

Installation

You can simply install this package from CRAN,

install.packages("smatr")

Or install the development version from GitHub,

# install.packages("remotes")
remotes::install_github("traitecoevo/smatr")

Issues and feature requests

Please report any issues or bugs.

To cite package smatr in publications use:

   Warton, David I., Duursma, Remko A., Falster, Daniel S. and Taskinen,
  Sara (2012) smatr 3 - an R package for estimation and inference about
  allometric lines Methods in Ecology and Evolution, 3(2), 257-259.  doi:10.1111/j.2041-210X.2011.00153.x. 

Get citation information for smatr in R with citation(package = 'smatr').

Copy Link

Version

Install

install.packages('smatr')

Monthly Downloads

1,378

Version

3.5-1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Falster

Last Published

July 28th, 2026

Functions in smatr (3.5-1)

ma

Major axis estimation and testing for one or several samples
leaflife

Leaf longevity and leaf mass per area for plant species from different sites
ggplot.sma

Plot a (S)MA fit using ggplot2
huber.M

Huber's M-estimator
leafmeas

Leaf mass per area and photosynthetic rate for plant species from different sites
makeLogMinor

Generate spacing for minor tick marks on a plot with log-scaled axes
meas.est

Measurement error variance estimation from repeated measures
line.cis

Slope and elevation of a (standardised) major axis, with confidence intervals
lr.b.com

Likelihood ratio statistic, assuming a common slope (called by slope.com)
make_plot_data

Build point and fitted-line data for plotting an sma fit
slope.test

One-sample test of a (standardised) major axis slope
predict.sma

Predicting from an (Standardized) major axis estimation
slope.com

Common slope test amongst several allometric lines
plot.sma

Draw an X-Y plot
residuals.sma

Extract model residuals
seqLog

Sequence Generation
robust.factor

Computers robust factor for elevation, slope and CI
print.sma

Print an object of class 'sma'.
shift.com

Test for no mean shift along a common (standardised) major axis
summary.sma

Print a summary
sma

(Standardized) major axis estimation and testing for one or several samples
multcompmatrix

Multiple comparisons graphical matrix
smatr-package

(Standardised) Major Axis Estimation and Testing Routines
confint.sma

Returns confidence intervals for sma object
elev.test

One-sample test of a (standardised) major axis elevation
fitted.sma

Returns fitted values
b.com.est

Common slope estimation
get_coef

Extract a fitted coefficient for one level of the grouping variable
gamma.fun

Gamma function used in robust factor calculations
coef.sma

Extract coefficients from a 'sma' or 'ma' fit
elev.com

Test for equal elevation among several lines fitted with (standardised) major axes of common slope.
defineAxis

Defines axis for SMA object
alpha.fun

Utility functions for robust fitting