spgarbet / tangram

Table Grammar package for R
66 stars 3 forks source link

html5 - footnote annotation not matching #53

Closed xmarti6 closed 4 years ago

xmarti6 commented 4 years ago

Hi, I would like to report this bug , I think that annotation is not correctly set in this case:


data<-data.frame(groups=c("A","A","A","A","A","A","A","A","A","A","A","A","A","A","B","B","B","B","B","B","B","B","B","B","B","B","B","B","C","C","C","C","C","C","C","D","D","D","D","D","D","D","E","E","E","E","E","E","E","F","F","F","F","F","F","F"),
age=c(10,24,39,16,19,20,11,50,28,21,2,34,29,52,44,48,33,56,18,36,37,1,41,42,12,51,35,9,40,30,27,53,5,31,3,13,32,7,45,6,25,43,4,17,26,23,55,22,15,47,46,54,14,38,8,49))

summary(aov(age ~ groups, data = data))
#>             Df Sum Sq Mean Sq F value Pr(>F)
#> groups       5   1220   243.9   0.909  0.483
#> Residuals   50  13410   268.2
tangram::tangram(age ~ groups, data = data)
#> ====================================================
#>         N         age             Test Statistic    
#> ----------------------------------------------------
#> groups                        F_{5,50}=0.91, P=0.483
#>   A     14  15.6 *22.5* 34.4                        
#>   B     14  17.5 *36.5* 44.3                        
#>   C     7   8.7 *30.0* 38.5                         
#>   D     7   8.0 *25.0* 41.2                         
#>   E     7   15.3 *22.0* 25.5                        
#>   F     7   18.0 *46.0* 48.7                        
#> ====================================================

Created on 2019-09-27 by the reprex package (v0.3.0)

imagen

spgarbet commented 4 years ago

You're using the much older version from cran. If you install the edge version from github the example changes a bit. There was an annotation issue that has been fixed on edge, however this is not it.

The annotation is referring to the use of Dr. Harrell's spearman2 function (https://rdrr.io/cran/Hmisc/man/biVar.html) which computes a Kruskal-Wallis via the F-distribution. I can't find a paper on this, but it goes back to S days.