Hello, is it possible to run the Hutcheson t-test (https://www.sciencedirect.com/science/article/abs/pii/0022519370901244) on R? How? -- Best regards, Luigi
On Mon, 7 Sep 2020 11:17:36 +0200 Luigi Marongiu <marongiu.luigi at gmail.com> wrote:> Hello, > is it possible to run the Hutcheson t-test > (https://www.sciencedirect.com/science/article/abs/pii/0022519370901244) > on R?Almost surely. With R, all things are possible. :-)> How?Program it up? cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
This website has an example calculation shown in Excel Which might help in programming it in R. https://www.dataanalytics.org.uk/comparing-diversity/ Bernard Sent from my iPhone so please excuse the spelling!"> On Sep 7, 2020, at 6:17 PM, Rolf Turner <r.turner at auckland.ac.nz> wrote: > > ? >> On Mon, 7 Sep 2020 11:17:36 +0200 >> Luigi Marongiu <marongiu.luigi at gmail.com> wrote: >> >> Hello, >> is it possible to run the Hutcheson t-test >> (https://www.sciencedirect.com/science/article/abs/pii/0022519370901244) >> on R? > > Almost surely. With R, all things are possible. :-) > >> How? > > Program it up? > > cheers, > > Rolf Turner > > -- > Honorary Research Fellow > Department of Statistics > University of Auckland > Phone: +64-9-373-7599 ext. 88276 > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]
On 9/7/20 3:17 PM, Rolf Turner wrote:> On Mon, 7 Sep 2020 11:17:36 +0200 > Luigi Marongiu <marongiu.luigi at gmail.com> wrote: > >> Hello, >> is it possible to run the Hutcheson t-test >> (https://www.sciencedirect.com/science/article/abs/pii/0022519370901244) >> on R? > Almost surely. With R, all things are possible. :-) > >> How? > Program it up?To Luigi; Citing a 50 year-old paper that sits behind a paywall seems a bit ineffective in getting coding support. Seems this might be a more appropriate question on the R-SIG-ecology or R-SIG-phylo mailing lists. (It would also have been appropriate to indicate what sort of searching has been done. My efforts at searching led me to the vegan package and this tutorial: https://cran.r-project.org/web/packages/vegan/vignettes/diversity-vegan.pdf . It doesn't appear to have a Hutcheson t-test, but I'm guessing that is because there are more modern and more sophisticated tests currently in use.) See: https://www.r-project.org/mail.html -- David> > cheers, > > Rolf Turner >
Could it be that the test you are looking for is implemented in the vegan package (function diversity(... index = "shannon" ...), and/or the BiodiversityR package, function "diversityresult (..., index = "Shannon",...) best, Karl Schilling
Hello, No, it's not. That's the Shannon diversity index, the test the OP is looking for is a t-test for Shannon diversity index equality. The index itself is easy to code. A very simple example, based on ?vegan::diversity: library(vegan) data(BCI) H <- diversity(BCI[1,]) # just first row divers <- function(n){ p <- n/sum(n) log_p <- numeric(length(n)) log_p[n != 0] <- log(p[n != 0]) -sum(p * log_p) } HRui <- divers(BCI[1,]) identical(H, HRui) #[1] TRUE The vegan function is more general, it applies this and other indices calculations to a matrix or array. The t-test doesn't seem difficult to code. The variance formula in the paper and in the OP's posted link [1] are not the same, the original has one more term, but the degrees of freedom formula are the same. It all seems straightforward coding. Luigi: Maybe later today I will have time but I am not making promises. [1] https://www.dataanalytics.org.uk/comparing-diversity/ Hope this helps, Rui Barradas ?s 12:35 de 08/09/20, Karl Schilling escreveu:> Could it be that the test you are looking for is implemented in the > vegan package (function diversity(... index = "shannon" ...), and/or the > BiodiversityR package, function "diversityresult (..., index = > "Shannon",...) > > best, > Karl Schilling > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.