[R] Pairwise testing with pairwise.prop.test

Stephen Ellison S@E|||@on @end|ng |rom LGCGroup@com
Mon Apr 1 18:32:49 CEST 2019


> > 3) Is there a way to assign the numbers to the treatment group that they
> were
> > originally in? For example, "1" in the result should be "3", indicating that
> > that was the temperature the experiment took place at. Pairwise.prop.test
> > doesn't seem to accept matrices with more than 2 columns.
> 
> No. The test is to do the pairwise comparisons between the samples. 

A possible wrinkle, there: If you know the treatment labels for your group numbers (1...n in a simple htest  p-value matrix), you could relabel the htest p-value matrix via its dimnames property. For example, in the smokers example under ?pairwise.prop.test:

smk.pwtst <- pairwise.prop.test(smokers, patients)
groupnames <- paste("group", 1:4) #This would have to be manual for your example

new.dims <- list(groupnames[1:3],       #we know this is from 1:(n-1)
                                 groupnames[2:4])       #and this is 2:n

dimnames(smk.pwtst$p.value) <- new.dims

smk.pwtst
#         group 1 group 2 group 3
# group 2 1.000   -       -      
# group 3 1.000   1.000   -      
# group 4 0.119   0.093   0.124  

Steve Ellison



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list