R Data.Table Compare Groups Simulteanous

筅森魡賤 提交于 2020-05-17 07:02:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!