null.test | R Documentation |
Testing the difference between the observed disparity and disparity under a null model.
null.test(
data,
replicates = 100,
null.distrib,
null.args = NULL,
null.cor = NULL,
null.scree = NULL,
alter = "two-sided",
scale = FALSE,
...
)
data |
a |
replicates |
the number of replicates for the test (default = |
null.distrib |
one or more distribution functions to generate the null model to be passed to |
null.args |
any additional distribution arguments to be passed to |
null.cor |
an additional correlation matrix to be passed to |
null.scree |
an additional vector of variance per axis (equivalent to screeplot output); |
alter |
the type of alternative hypothesis (H1) as used in |
scale |
whether to scale the simulated and the observed data. |
... |
optional arguments to be passed to |
Thomas Guillerme
Diaz, S., Kattge, J., Cornelissen, J.H., Wright, I.J., Lavorel, S., Dray, S., Reu, B., Kleyer, M., Wirth, C., Prentice, I.C. and Garnier, E., 2016. The global spectrum of plant form and function. Nature, 529(7585), pp.167-171.
space.maker
, test.dispRity
## Load the Beck & Lee 2014 data
data(BeckLee_mat50)
## Calculating the disparity as the ellipsoid volume
obs_disparity <- dispRity(BeckLee_mat50, metric = ellipsoid.volume)
## Testing against normal distribution
results <- null.test(obs_disparity, replicates = 100, null.distrib = rnorm)
results ; plot(results)
## Running the test on multiple subsets (may take some time!)
## Generating the subsets
groups <- as.data.frame(matrix(data = c(rep(1, 12), rep(2, 13), rep(3, 12),
rep(4, 13)), dimnames = list(rownames(BeckLee_mat50))), ncol = 1)
customised_subsets <- custom.subsets(BeckLee_mat50, groups)
## Bootstrapping the data
bootstrapped_data <- boot.matrix(customised_subsets, bootstraps = 100)
## Calculating variances of each dimension
sum_variances <- dispRity(bootstrapped_data, metric = c(sum, variances))
## Testing against normal distribution
results <- null.test(sum_variances, replicates = 100, null.distrib = rnorm)
summary(results) ; plot(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.