[R] Calculating Kendall's tau

Bert Gunter gunter.berton at gene.com
Tue Mar 31 18:32:22 CEST 2015


OK.

But always reply to the list (which I am ccing here) so that everyone
knows -- and re-submit your OP in **PLAIN TEXT**, not html, as this is
a plain text  list and html typically garbles everything.

Also, reading and following the posting guide (see end of this email)
generally improves your chance of getting useful help.

-- Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll




On Tue, Mar 31, 2015 at 9:24 AM, Desta Yoseph <desta_yo at yahoo.com> wrote:
> Dear Bert,
> It is not homework. Actually my real work is for 10,360 sample data. But if
> some one showed me for 31 sample dataset, i can manage for large sample
> data.
> hopefully this give you few hint why i really want  someone help.
> cheers
>
>
>
> On Tuesday, March 31, 2015 6:14 PM, Bert Gunter <gunter.berton at gene.com>
> wrote:
>
>
> This sounds like homework. Homework is discouraged on this list (but
> you might get lucky).
>
> Cheers,
> Bert
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
> (650) 467-7374
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> Clifford Stoll
>
>
>
>
> On Tue, Mar 31, 2015 at 9:08 AM, Desta Yoseph via R-help
> <r-help at r-project.org> wrote:
>> I am analyzing trend  using Mann-kendall  test for 31 independent sample,
>> each sample  have 34 years dataset.  I supposed to find Kendall “tau” for
>> each sample. The data is arranged in column wise (I attached  the data).To
>> find Kendall tau, I wrote R script as:
>>      desta<-read.csv("rainfall.csv", header=T, sep=",")
>> require(Kendall)              MK<-function(y) {                nc<-ncol(y)
>> MannKendalltau<- numeric(nc)                for(i in 2:nc){
>> MannKendalltau[i]<-MannKendall(y[,i])          }            MannKendalltau
>> }    MK(desta)
>> The  displayed result showed  both “tau”  and “2-sided p-value”in
>> unorganized way.  But, I want only “tau” value that is presented in
>> organized  manner. Anyone can tell me how can I get orderly displayed  “tau”
>> value? here is my sample result:      [[1]][1] 0
>> [[2]][1] 0.4352941attr(,"Csingle")[1] TRUE
>> [[3]][1] 0.5462185attr(,"Csingle")[1] TRUE
>> [[4]][1] 0.4218487attr(,"Csingle")[1] TRUE....Thank you for your guidance
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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.
>
>



More information about the R-help mailing list