R ggplot2:使用chisq.test和多个构面的具有显着性水平的箱线图

我正在尝试使用chisq.test绘制两组的显着性水平。

我的数据集如下:

R ggplot2:使用chisq.test和多个构面的具有显着性水平的箱线图

我使用'Marker','Case'和'Section'作为ID在两种类型的数据('Number'和'Theo')之间执行chisq.test。我测试了每个试验的p值均小于0.05。但是,在图中的结果中,我所有显着性水平均为“ NS”,即使我更改为t检验,其显着性水平也为“ NS”。这是不可能的。

我的代码是:

ggplot(Profile_melt,aes(type,value)) + 
geom_boxplot(aes(fill = factor(type),alpha = 0.5),outlier.shape = NA,show.legend = FALSE) +
geom_jitter(width = 0.2,size = 2,show.legend = FALSE,aes(colour = factor(type)),alpha = 0.5) +
theme_bw() +
geom_signif(comparisons = combn(levels(Profile_melt$type),2,simplify = F)[-4],map_signif_level = TRUE,test = 't.test',textsize = 2) +
#stat_compare_means(method = "chisq.test") +
facet_grid(Case ~ Marker,scales = 'free') +
background_grid(major = 'y',minor = "none") + # add thin horizontal lines 
xlab('x,mm') +
ylab(expression(paste('Density,/',mm^2,)))+
theme(axis.text = element_text(size = 15),axis.title = element_text(size = 20),legend.text = element_text(size = 38),legend.title = element_text(size = 30),strip.background = element_rect(colour="black",fill="grey"),strip.text = element_text(margin = margin(10,10,10),size = 25)) +
panel_border()

输出图为:

R ggplot2:使用chisq.test和多个构面的具有显着性水平的箱线图

有什么解决办法吗?

fishingboy123 回答:R ggplot2:使用chisq.test和多个构面的具有显着性水平的箱线图

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2958781.html

大家都在问