sparkh2o
sparkh2o

Reputation: 264

Pairwise comparisons with cell values less than 1

This is an example modified from https://rcompanion.org/rcompanion/b_05.html. I have a 4 by 2 matrix, with cell values less than 1. I would like to compare pairewise differences between supplement. I would like to show that Selenium is different when compared with Vitamin E and Selenium+E as shown. The current code shows all 1's for the p-values.

I would like to modify the current code to perform a test that accounts for the differences when the percentages are less than 1.

Input =("
Supplement     No.cancer  Cancer
'Selenium'     0.894       0.776
'Vitamin E'    0.973       0.916
'Selenium+E'   0.988       0.936
'Placebo'      0.967       0.847
")
Matriz = as.matrix(read.table(textConnection(Input),
                              header=TRUE,
                              row.names=1))
Matriz
pairwiseNominalIndependence(Matriz,
                            fisher = FALSE,
                            gtest  = FALSE,
                            chisq  = TRUE,
                            method = "fdr")

Upvotes: 0

Views: 66

Answers (1)

Sal Mangiafico
Sal Mangiafico

Reputation: 510

You can't use a chi-square test of association unless you have a table of (whole) counts. But some effect size statistics that are often applied to tables of counts might be applicable. For example, you could look at the odds ratio across pairwise rows.

Upvotes: 1

Related Questions