qrank: Quantiles of exact and approximated null distribution of rank... In pvrank: Rank Correlations

Description

For a given level of significance, this routine computes approximated or exact conservative and/or liberal critical values under the hypothesis of no association.

Usage

 1 2 qrank(prob, n, index="spearman", approx="vggfr", print = FALSE, lower.tail = TRUE)

Arguments

 prob the nominal level of significance. n the number of ranks. index a character string that specifies the rank correlation used in the test. Acceptable values are: "spearman", "kendall","gini", "r4" (Tarsitano), "fy1" (Fisher-Yates based on means), "fy2" (Fisher-Yates based on medians),"sbz" (symmetrical Borroni-Zenga). Only enough of the string to be unique is required. approx a character string that specifies the type of approximation to the null distribution: "vggfr", "exact","gaussian","student". print FALSE suppresses partial output. lower.tail logical; if TRUE (default), probability P[X <= x] is computed, otherwise P[X>x]. In brief, lower tailed tests are used to test for negative correlation and upper tailed tests are used to test for positive correlation.

Details

This routine provides two exact quantiles corresponding to a conservative level (next smaller exact size) and a liberal level (next larger exact size). It can be noted that, liberal levels yield critical values of the two-sided 2<alpha-level test.

In the case of n>26 (Spearman) or n>60 (Kendall) or n>24 (Gini) or n>15 (r_4, fy1, fy2 and sbzZ), an approximated, but unique quantile is produced according to approx. The default option is "vggfr" in the case of Spearman and r_4; "gaussian" for Kendall, "fy1", "fy2", and "sbz"; "student" for Gini's cograduation.

A recursive formula is employed in the case of Kendall's rank correlation. Exact computations use frequencies obtained by complete enumeration for the other coefficients.

Value

a list containing the following components:

 n number of ranks. Statistic coefficient of rank order association Level nominal level Cq conservative quantile Cv conservative p-value Lq liberal quantile Lv liberal p-value

Note

The quantile function Q(.) of a symmetrical distribution satisfies:

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 data(Insuhyper); attach(Insuhyper) op<-par(mfrow=c(1,1), mgp=c(1.8,.5,0), mar=c(2.8,2.7,2,1),oma=c(0,0,0,0)) plot(PI,TG,main="Rank correlation between obesity and triglyceride response", xlab="Ponderal Index", ylab="Plasma triglyceride concentration", pch=19, cex=0.9, col= "rosybrown4") text(PI,TG,labels=rownames(Insuhyper),cex=0.6,pos=c(rep(3,10),1,3,1,rep(3,4),1.3)) abline(v=mean(PI),col="black",lty=2,lwd=1) abline(h=mean(TG),col="darkblue",lty=2,lwd=1) par(op) r<-comprank(PI,TG,"spearman","gh")$r a1<-qrank(0.025, length(PI), "sp", "vggfr", print = FALSE,lower.tail = TRUE)$Cq a2<-qrank(0.975, length(PI), "sp", "vggfr", print = FALSE,lower.tail = TRUE)$Cq cat(round(a1,4),round(r,4),round(a2,4)) r<-comprank(PI,TG,"kendall")$r b1<-qrank(0.95, length(PI), "ke", "ex", lower.tail = TRUE)$Cq # p = .05, one-tailed (upper) b2<-qrank(0.05, length(PI), "ke", "ex", lower.tail = TRUE)$Cq # p = .95, one-tailed (upper) cat(round(b2,4),round(r,4),round(b1,4)) detach(Insuhyper) ##### # a<-qrank(0.10,61,"Ke","St") a<-qrank(0.01,25,"Sp","Ga",FALSE,FALSE);a$Cq a<-qrank(0.03,11,"fy1","Ga",FALSE,FALSE);a$Cq a<-qrank(0.03,11,"fy2","Ga",FALSE,FALSE);a$Cq a<-qrank(0.03,11,"sbz","Ga",FALSE,FALSE);a$Cq a<-qrank(0.001,15,"r4","Ex",FALSE,FALSE);cat(a$Cq,a$Lq,"\n") a<-qrank(0.01,14,"fy2","Ex",FALSE,FALSE);cat(a$Cq,a$Lq,"\n") ##### # a<-qrank(0.05,27,"Gi","Vg",FALSE,FALSE);a\$Cq
{"ft_lang_label":"__label__en","ft_lang_prob":0.62038815,"math_prob":0.9877928,"size":3532,"snap":"2022-05-2022-21","text_gpt3_token_len":1260,"char_repetition_ratio":0.10147392,"word_repetition_ratio":0.05529954,"special_character_ratio":0.34229898,"punctuation_ratio":0.23150358,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9965716,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-27T21:51:45Z\",\"WARC-Record-ID\":\"<urn:uuid:e1f4956c-83c6-4bd1-8118-08736f2e31ab>\",\"Content-Length\":\"71198\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:33ac1f6c-28bb-4f66-92b0-25a3cdd6c24e>\",\"WARC-Concurrent-To\":\"<urn:uuid:12fa4133-416d-4c00-860a-f3d530b0c50c>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/pvrank/man/qrank.html\",\"WARC-Payload-Digest\":\"sha1:IPFUYQEFGGYU5L6AJXXZI7SUEULTTIJB\",\"WARC-Block-Digest\":\"sha1:XS4E6CKY5NYKSCAWBB5CFJ537FXYRODY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320305288.57_warc_CC-MAIN-20220127193303-20220127223303-00168.warc.gz\"}"}