calcTaronesTest is used to test whether the OR in different strata are different.
It is integrated from
https://github.com/the8thday/ClinStats/blob/master/R/Tarones.R). The original
MIT license is included in the source code. The function
is included for validation purpose. Please use the most updated function in
ClinStats package for related calculation in a non-GLP environment.
Details
modified the output to return p-values, need metafor package to run. This function is not really used in GLP calculations as it is not designed for ecotox studies where usually only one control is included. However, it could be useful in refinement analyses.
Examples
mymatrix1 <- matrix(c(4,5,5,103),nrow=2,byrow=TRUE)
colnames(mymatrix1) <- c("Disease","Control")
rownames(mymatrix1) <- c("Exposure","Unexposed")
mymatrix2 <- matrix(c(10,3,5,43),nrow=2,byrow=TRUE)
colnames(mymatrix2) <- c("Disease","Control")
rownames(mymatrix2) <- c("Exposure","Unexposed")
mylist <- list(mymatrix1,mymatrix2)
calcTaronesTest(mylist)
#> [1] "Pvalue for Tarone's test = 0.627420741721689"
#> $pval
#> [1] 0.6274207
#>
#> $tarone
#>
#> Equal-Effects Model (k = 2)
#>
#> I^2 (total heterogeneity / total variability): 0.00%
#> H^2 (total variability / sampling variability): 0.24
#>
#> Test for Heterogeneity:
#> Q(df = 1) = 0.2423, p-val = 0.6225
#>
#> Model Results (log scale):
#>
#> estimate se zval pval ci.lb ci.ub
#> 3.1355 0.5741 5.4613 <.0001 2.0102 4.2608
#>
#> Model Results (OR scale):
#>
#> estimate ci.lb ci.ub
#> 23.0006 7.4652 70.8663
#>
#> Cochran-Mantel-Haenszel Test: CMH = 36.6043, df = 1, p-val < 0.0001
#> Tarone's Test for Heterogeneity: X^2 = 0.2356, df = 1, p-val = 0.6274
#>
#>
if (FALSE) { # \dontrun{
calcTaronesTest(mymatrix1)
} # }