小编MJW*_*MJW的帖子

在R中可视化比值比的简单方法

我需要帮助来创建一个简单的情节来为我老板的演示文稿显示比值比 - 这是我的第一篇文章.我是一个真正的R初学者,我似乎无法让这个工作.我尝试调整我在网上找到的一些显然产生的代码:

点图

我想手动输入我的OR和CI,因为这更直接,所以这就是我所拥有的:

# Create labels for plot
boxLabels = c("Package recommendation", "Breeder’s recommendations", "Vet’s 
recommendation", "Measuring cup", "Weigh on scales", "Certain number of 
cans", "Ad lib feeding", "Adjusted for body weight")

# Enter OR and CI data. boxOdds are the odds ratios, 
boxCILow is the lower bound of the CI, boxCIHigh is the upper bound.

df <- data.frame(yAxis = length(boxLabels):1, boxOdds = c(0.9410685, 
0.6121181, 1.1232907, 1.2222137, 0.4712629, 0.9376822, 1.0010816, 
0.7121452), boxCILow = c(-0.1789719, -0.8468693,-0.00109809, 0.09021224, 
-1.0183040, -0.2014975, -0.1001832,-0.4695449), …
Run Code Online (Sandbox Code Playgroud)

plot r ggplot2

6
推荐指数
1
解决办法
8283
查看次数

标签 统计

ggplot2 ×1

plot ×1

r ×1