我正在努力获得关于回归线的置信区间。我的数据由7列和50000行组成。
ID H.FC HFD N.FC NFD Group
G00000000004 1.08403833300442 0.00209119205547622 1.12705351468201 0.0017652841766293 BvsA
G00000000059 1.70298155378132 0.000146008455537281 1.78927991144484 0.000126476263754446 BvsA
G00000000067 1.48885136450707 1.94192154467639e-05 1.49169658915702 5.47633140183071e-05 CvsA
G00000000081 5.92680429312136 3.63075878342954e-06 5.89059544062979 7.07992913581687e-06 DvsA
G00000000086 0.499795076715132 0.00265935106849242 0.542319766242586 0.00212335608196823 BvsC
G00000000102 -2.60510733887004 0.000669953697126189 -2.62720386931755 0.000122899865824463 BvsA
G00000000104 -2.80909148854584 0.00686396994798396 -2.94362698679174 0.00342818761913247 BvsA
G00000000106 0.255264785072867 0.0388723342557597 0.174743590276556 0.197263787912382 BvsD
G00000000109 1.32895814248434 0.000311378914835491 1.30541212379603 0.000308851884560488 EvsF
这是我的代码:
data <- read.table("grid_contrast_1-8.tsv", header=T)
df <- data.frame(data$H.FC, data$N.FC, data$Group)
png("grid_scatter.png")
ggplot(df, aes(data.H.FC, data.N.FC, color = data.H.FC)) +
geom_point(size = 0.5) +
stat_smooth(geom = 'line', alpha = 0.5, se = TRUE, color = "black", level = 0.95) +
facet_wrap(~ data.Group) +
labs(x = "H", y = "F") +
scale_color_gradient(low = "#0091ff", high = "#f0650e")
dev_off()
以下是我得到的内容:
![所有组的散点图网格](https://istack.dev59.com/fU5Wc.webp)
![例子](https://istack.dev59.com/WSnwL.webp)
非常感谢。
ggplot(df, aes(data.H.FC, data.N.FC, color = data.H.FC)) +geom_point(size=0.5) +geom_smooth(se=TRUE,color="black",level=1-1e-10,method='lm',fill="green") +facet_wrap(~ data.Group)+labs(x="H",y="N",color="H")+scale_color_gradient(low = "#0091ff", high = "#f0650e")
- utritala