问题
library(data.table)
data = data.table("LABEL1" = c(1,1,1,2,2,2),
"LABEL3" = c(1,2,3,1,2,3),
"CAT"=runif(6),
"FOX"=runif(6),
"DOG"=runif(6),
"MOUSE"=runif(6),
"BIRD"=runif(6))
I wish to execute t-test for variables CAT:BIRD, these are proportions. I want to compare these groups:
LABEL1=1 & LABEL3=2 gets compared to LABEL1=1 & LABEL3=1
LABEL1=1 & LABEL3=3 gets compared to LABEL1=1 & LABEL3=1
LABEL1=2 & LABEL3=2 gets compared to LABEL1=2 & LABEL3=1
LABEL1=2 & LABEL3=3 gets compared to LABEL1=2 & LABEL3=1
and I hope to store P VALUE like such:
来源:https://stackoverflow.com/questions/61623465/r-data-table-compare-groups-simulteanous