【发布时间】:2020-11-28 15:01:37
【问题描述】:
我有按年龄累积的突变数量和给定年龄的突变中位数,如下所示
> dput(head(data))
structure(list(Age = c(44, 44.8, 47.5, 48.1, 48.8, 50.2), Mutations = c(326.2411348,
218.7943262, 882.9787234, 361.7021277, 901.0638298, 742.1985816
), Age.group = c(40L, NA, NA, NA, NA, 50L), Median.of.mutation.per.age.group = c(576.2411348,
NA, NA, NA, NA, 374.4680851)), row.names = c(NA, 6L), class = "data.frame")
>
我想要这样的情节
每个点代表特定年龄(如 40、50、60、70 岁)个体的突变中位数。红线和绿线显示斜率的最佳估计值(即随时间累积的突变);斜率的 95% 置信区间以浅绿色和浅红色阴影显示。
我试过了
cor.test(c(40,50,60,70),c(576.2411348,374.4680851,352.8368794,425.5319149))
Pearson's product-moment correlation
data: c(40, 50, 60, 70) and c(576.2411348, 374.4680851, 352.8368794, 425.5319149)
t = -1.0812, df = 2, p-value = 0.3927
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.9903522 0.8497519
sample estimates:
cor
-0.6073455
这与我真正需要的相差甚远
有什么帮助吗?
【问题讨论】:
标签: r plot linear-regression correlation confidence-interval