R: Analysis of Deviance, Entropy and Diversity Tables
anova.mdm
R Documentation
Analysis of Deviance, Entropy and Diversity Tables
Description
Provides an analysis of deviance, entropy and diversity for a collection of diversity models (outputs from mdm).
Usage
## S3 method for class 'mdm'
anova(object, ..., topnote = TRUE, cols = c("df","dev","ent","div")[1:4])
Arguments
object, ...
objects of class mdm, usually, a result of a
call to mdm.
topnote
If TRUE then model descriptions appear above the anova table, if FALSE
they appear as the first column of the table
cols
The list of colums to print out. Defaults to all columns.
Details
Specifying a single object gives a sequential analysis of deviance
table for that fit. That is, the reductions in the residual sum of
deviances, plus the residual deviance
The deviances are converted into entropies and diversities, and differences
in deviances are converted into differnces in entropies and diversities.
If more than one object is specified, the table has a row for the
residual degrees of freedom and sum of deviances for each model.
For all but the first model, the change in degrees of freedom and
deviances. This only makes statistical sense if the models are nested.
It is conventional to list the models from smallest to largest,
but this is up to the user.
Value
The analysis of deviance, entropy and diversity for a collection of diversity models.
Note
mdm is a modifed version of multinom in the
nnet package.
References
De'ath, G. (2011) The Multinomial Diversity Model: Linking Shannon Diversity
To Multiple Predictors.
Ripley, B. D. (1996) Pattern Recognition and Neural Networks. Cambridge.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S.
Fourth edition. Springer.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MDM)
Loading required package: nnet
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MDM/anova.mdm.Rd_%03d_medium.png", width=480, height=480)
> ### Name: anova.mdm
> ### Title: Analysis of Deviance, Entropy and Diversity Tables
> ### Aliases: anova.mdm
> ### Keywords: mdm
>
> ### ** Examples
>
> library(MDM)
> data(spider6)
> fit0 <- mdm(y2p(spider6[,1:6])~1,data=spider6)
# weights: 12 (5 variable)
> fit1 <- mdm(y2p(spider6[,1:6])~Water,data=spider6)
# weights: 18 (10 variable)
initial value 50.169265
iter 10 value 38.780815
iter 20 value 38.409944
final value 38.409941
converged
> fit2 <- mdm(y2p(spider6[,1:6])~Water+Herbs,data=spider6)
# weights: 24 (15 variable)
initial value 50.169265
iter 10 value 36.791764
iter 20 value 35.415854
iter 30 value 35.415361
final value 35.415361
converged
> fit3 <- mdm(y2p(spider6[,1:6])~Site,data=spider6)
# weights: 174 (140 variable)
> anova(fit0,fit1,fit2,fit3)
Deviances, Entropies and Diversities of Parametric Diversity Models
Response: y2p(spider6[, 1:6])
Model 1: y2p(spider6[, 1:6]) ~ 1
Model 2: y2p(spider6[, 1:6]) ~ Water
Model 3: y2p(spider6[, 1:6]) ~ Water + Herbs
Model 4: y2p(spider6[, 1:6]) ~ Site
DF DF-Diff Dev Dev-Diff Ent Ent-Diff Div Div-Ratio
1 135 94.105 1.6804 5.3680
2 130 5 76.820 17.2856 1.3718 0.30867 3.9424 1.3616
3 125 5 70.831 5.9892 1.2648 0.10695 3.5425 1.1129
4 0 125 60.923 9.9075 1.0879 0.17692 2.9681 1.1935
>
>
>
>
>
> dev.off()
null device
1
>