Test if the elevation of a major axis or standardised major axis equals a
specific value. This can now be done via sma(y~x,elev.test=0)
, see
help on the sma
function.
elev.test(
y,
x,
test.value = 0,
data = NULL,
alpha = 0.05,
method = "SMA",
robust = FALSE,
V = matrix(0, 2, 2)
)
The Y-variable
The X-variable
The hypothesised value of the elevation (default value is 0)
Deprecated. Use with() instead (see Examples).
The desired confidence level for the 100(1-alpha)% confidence interval for the common slope. (Default value is 0.05, which returns a 95% confidence interval.)
The line fitting method:
linear regression
standardised major axis (this is the default)
major axis
If TRUE, uses a robust method to fit the lines and construct the test statistic.
The estimated variance matrix of measurement error. Default is that there is no measurement error.
The test statistic (a t-statistic).
The P-value, taken from the \(t_{n-2}\)-distribution. This is an exact test if residuals are normally distributed.
The hypothesised value of the elevation.
The estimated elevation.
A 100(1-alpha)% CI for the slope.
Tests if the line relating y to x has an elevation equal to test.value (which has a default value of 0). The line can be a linear regression line, major axis or standardised major axis (as selected using the input argument choice). The test is carried out usinga t-statistic, comparing the difference between estimated and hypothesised elevation to the standard error of elevation. As described in Warton et al (2006).
A confidence interval for the elevation is also returned, again using the t-distribution.
If measurement error is present, it can be corrected for through use of the input argument V, which makes adjustments to the estimated sample variances and covariances then proceeds with the same method of inference. Note, however, that this method is only approximate (see Warton et al 2006 for more details).
The test assumes the following:
y and x are linearly related
residuals independently follow a normal distribution with equal variance at all points along the line
The assumptions can be visually checked by plotting residual scores against
fitted axis scores, and by constructing a Q-Q plot of residuals against a
normal distribution, available using the plot.sma
function.
Setting robust=TRUE
fits lines using Huber's M estimation, and
modifies the test statistic as proposed in Taskinen & Warton (in review).
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 D.I. Warton. in review. Robust tests for one or more allometric lines.
#load the leaflife dataset:
data(leaflife)
#consider only the low rainfall sites:
leaf.low.rain <- subset(leaflife, rain=="low")
#construct a plot
plot(log10(leaf.low.rain$lma), log10(leaf.low.rain$longev),
xlab="leaf mass per area [log scale]", ylab="leaf longevity [log scale]")
#test if the SMA elevation is 0 for leaf longevity vs LMA
with(leaf.low.rain, elev.test(log10(lma), log10(longev)))
#> $t
#> [1] 110.5039
#>
#> $a
#> [1] 2.132489
#>
#> $p
#> [1] 8.08354e-42
#>
#> $a.ci
#> [1] 2.093130 2.171847
#>
#> $test.value
#> [1] 0
#>
#test if the MA elevation is 2
with(leaf.low.rain,elev.test(log10(lma), log10(longev),
test.value = 2, method = "MA"))
#> $t
#> [1] 6.99029
#>
#> $a
#> [1] 2.137169
#>
#> $p
#> [1] 7.604775e-08
#>
#> $a.ci
#> [1] 2.097148 2.177190
#>
#> $test.value
#> [1] 2
#>