Re: [R] Some code to run Hutcheson t-test using R

2020-09-11 Thread Luigi Marongiu
Thank you for the clarification. On Fri, Sep 11, 2020 at 2:36 PM Karl Schilling wrote: > > Dear Luigi: > > no, µ1µ2 is not "missing" > > First, it should actually be "µ1 - µ2". > > And as your usual null-hypothesis when comparing h1 and h2 is that they > are not different (i.e. µ1 = µ2), the latt

Re: [R] Some code to run Hutcheson t-test using R

2020-09-11 Thread Karl Schilling
Dear Luigi: no, µ1µ2 is not "missing" First, it should actually be "µ1 - µ2". And as your usual null-hypothesis when comparing h1 and h2 is that they are not different (i.e. µ1 = µ2), the latter term adds up to 0 and may be omitted. Karl Schilling __

Re: [R] Some code to run Hutcheson t-test using R

2020-09-11 Thread Luigi Marongiu
Actually, in the working example, Hutcheson himself did not report the term µ1µ2: `t0 = h1-h2/(var1-var2)^1/2`. so I think we can live without it. Case closed. Thank you On Fri, Sep 11, 2020 at 11:11 AM Luigi Marongiu wrote: > > Hello, > I have just realized in the original paper, the t test is d

Re: [R] Some code to run Hutcheson t-test using R

2020-09-11 Thread Luigi Marongiu
Hello, I have just realized in the original paper, the t test is defined as: `t = h1-h2 -(µ1µ2)/(var1-var2)^1/2`. is the term -(µ1µ2) missing in your formula? How to calculate µ1µ2? Thank you On Thu, Sep 10, 2020 at 2:41 PM Luigi Marongiu wrote: > > Update: > I also added the confidence interval

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Update: I also added the confidence interval for the Shannon index: ``` #! Hutcheson's t-test for Shannon diversity equality # thanks to Karl Schilling and Rui Barradas hutcheson = function(A, B){ # compute Shannon index, variance and sum of elements A_index <- Shannon(A) B_index <- Shannon(B

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Hello, thank you for the code. To explain better, when I used vegan, I did not count the species directly but simply prepared a dataframe where, for each species, I counted the number of samples bearing such species: ``` > str(new_df) 'data.frame': 3 obs. of 46 variables: $ NC_001416 Enterobacte

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Rui Barradas
Hello, Sorry, there's an instruction missing. See inline. Às 11:44 de 10/09/20, Rui Barradas escreveu: If you want a function automating Karl's code, here it is. It returns an object of S3 class "htest", R's standard for hypothesis tests functions. The returned object can then be subset in the

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Rui Barradas
If you want a function automating Karl's code, here it is. It returns an object of S3 class "htest", R's standard for hypothesis tests functions. The returned object can then be subset in the usual ways, ht$statistic, ht$parameter, ht$p.value, etc. library(QSutils) hutcheson.test <- function

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Update: I can see that you used the function Shannon from the package QSutils. This would supplement the iNext package I used and solve the problem. Thank you. On Thu, Sep 10, 2020 at 10:35 AM Luigi Marongiu wrote: > > Thank you very much for the code, that was very helpful. > I got the article b

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Thank you very much for the code, that was very helpful. I got the article by Hutcheson -- I don't know if I can distribute it , given the possible copyrights, or if I can attach it here -- but it does not report numbers directly: it refers to a previous article counting bird death on a telegraph e