我阅读了标记为黄铜的数据集,我需要找到 3 个国家每个年龄的 logit 函数日志 (p/1-p),并根据黄铜标准进行绘图。
dat <- structure(list(Age=c(1L,5L,10L,20L,30L),Brass_Standard=c(85,76.9,75,71.3,65.2),Sweden=c(98.7,98.4,98.2,97.9,97.4),Italy=c(84.8,73.9,72.1,69.9,64.1),Japan=c(96.4,95.2,94.7,93.8,91.7)),.Names=c("Age","Brass_Standard","Sweden","Italy","Japan"),class="data.frame",row.names=c("1","2","3","4","5"))
Age Brass_Standard Sweden Italy Japan
1 1 85.0 98.7 84.8 96.4
2 5 76.9 98.4 73.9 95.2
3 10 75.0 98.2 72.1 94.7
4 20 71.3 97.9 69.9 93.8
5 30 65.2 97.4 64.1 91.7
我将 R 中的 logit 定义为
logit<-function(x) log(x/(1-x))
但是当我尝试执行瑞典的值时,我得到了一个错误。其次,我如何绘制各国的 logit 曲线以进行比较。