绘图给出的优势比与 r

问题描述 投票:0回答:1

我正在尝试绘制

MAE ~ Plt
的优势比。
Plt
变量与高
MAE
比值比相关。

这是我的数据:

##dput(df)
df <- structure(list(MAE = c(0, 0, 0, 0, 
0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 
0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 
1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 
0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 
0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 
0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 
1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 
1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 
0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1), 
    Plt = c(1.70588235294118, 1.6390243902439, 14.1666666666667, 
    2.40559440559441, 3.33093525179856, 2, 2.63316582914573, 
    3.28947368421053, 2.60194174757282, 3.40714285714286, 6.30434, 
    1.19732441471572, 2.41509433962264, 5.21875, 3.89189189189189, 
    3.31914893617021, 3.14583333333333, 7.46017699115044, 1.9704641350211, 
    2.8411214953271, 2.53672316384181, 2.88888888888889, 1.35714285714286, 
    1.33809523809524, 2.20108695652174, 2.7520325203252, 1.35151515151515, 
    2.73333333333333, 1.625, 2.2, 5.3, 4.125, 5.76923076923077, 
    2.71428571428571, 3.76, 1.2, 3.72727272727273, 2.125, 4.09090909090909, 
    22, 2.15, 2.42857142857143, 3.85714285714286, 3.05, 3.53333333333333, 
    5, 3, 1.53333333333333, 1.82142857142857, 1.1, 7.90909090909091, 
    3.53333, 1.65, 4.375, 3.3125, 4.15384, 1.58333333333333, 
    13.428, 2.30769230769231, 1.76190476190476, 2.35714285714286, 
    2.85714285714286, 1.25, 2.05555555555556, 4.53846153846154, 
    1.45714285714286, 1.96153846153846, 1.93103448275862, 4.666, 
    5.57142857142857, 3.055, 5.07692307692308, 3.85714285714286, 
    2.25, 1.71428571428571, 3.57894736842105, 3.38095238095238, 
    8.75, 6.38461538461539, 1.77777777777778, 1.56521739130435, 
    4.357, 5, 4.7001329787234, 3.29411764705882, 2.38461538461538, 
    5, 8.61538461538461, 4.25, 1.55555555555556, 2.33333333333333, 
    3.3, 3.666, 2.7333, 3.05555555555556, 1.68181818181818, 9.05555555555556, 
    2.79049676025918, 1.17857142857143, 2.8125, 5.5454, 1.36842105263158, 
    2.65, 3.69230769230769, 2.8421052631579, 2.33333333333333, 
    2.79166666666667, 4.70588235294118, 8, 1.48148148148148, 
    12, 3.06666666666667, 3.22222222222222, 3.61538461538462, 
    3.75343249427918, 6.33333333333333, 3.6875, 2.46153846153846, 
    6.77777777777778, 1.58823529411765, 5.07692307692308, 3.72727272727273, 
    10.8333333333333, 7.125, 1.58823529411765, 11.6666666666667, 
    2.46153846153846, 2.33333333333333, 1.55555555555556, 3.3125, 
    3.5, 2.23047, 1.75, 2.17647058823529, 3.2, 4.8, 1.42105263157895, 
    2.14285714285714, 4.07692307692308, 3.31578947368421, 1.83333333333333, 
    3.53846153846154, 2.15789473684211, 1.64705882352941, 1.45, 
    2.82352941176471, 1.3, 3.29411764705882, 3.57894736842105, 
    2.25352112676056, 1.84615384615385, 2.42857142857143, 3.25, 
    3.4, 1.40909090909091, 5.5, 4.22222222222222, 1.30434782608696, 
    3.36363636363636, 2.75, 2.83333, 10.4, 5.25, 1.78947368421053, 
    1.76470588235294, 3.63636363636364, 2.5, 2.35654101995565, 
    1.5, 2.14285714285714, 2.90909090909091, 2.78571428571429, 
    7.9, 3.5, 5.8, 1.72, 2.78947368421053, 3.2142, 1.95454545454545, 
    10, 2.66666666666667, 1.90909090909091, 7, 3.15384615384615, 
    3.15384615384615, 6, 3.61111111111111, 2.375, 2.34782608695652, 
    2.73333333333333, 5.09090909090909, 1.22222222222222, 2.36363636363636, 
    5.8, 3.375, 1.95, 16.25, 1.51724137931034, 2.1875, 3.77777777777778, 
    4.07142857142857, 7.4285, 2.06666666666667, 3.45454545454545, 
    1.8, 3.5, 7.28571428571429, 2.1875, 15.2857142857143, 5.5, 
    0.545454545454546, 3.8, 0.9025, 5.45454545454545, 5.21428571428571, 
    9.987, 2.33333333333333, 2.61111111111111, 4.44444444444444, 
    3.81818181818182, 3.25, 2.92307692307692, 8.14285714285714, 
    1.5, 3.5, 4.57142857142857, 4.6, 12.4444444444444, 1, 2.05263157894737, 
    2.72, 2.23529411764706, 3.15, 3.09090909090909, 4.66666666666667, 
    12, 3.33333333333333, 0.79591, 3.75, 10.2222222222222, 2.94444444444444, 
    5.6875, 7.14285714285714, 2.4736, 4.41666666666667, 1.82142857142857, 
    4.125, 1.44444444444444, 1.34615384615385, 3.72727272727273, 
    5, 5.54545454545454, 3.47517730496454, 2.5625, 13.1428571428571, 
    4.75, 2, 2.5, 2.9375, 2.53333333333333, 1.23809523809524, 
    5.69230769230769, 1.9, 3.28571428571429, 0.916666666666667, 
    3.46153846153846, 3.125, 9, 16.4, 3.125, 11.2, 14.1428571428571, 
    4.27272727272727, 5.1875, 7.875, 4.58333333333333, 1.6, 5.4, 
    4.2, 3.69230769230769, 1.37037037037037, 10.1818181818182, 
    3.38888888888889, 0.8, 4, 2.11764705882353, 19.5, 3.25, 2.76923076923077, 
    7.8, 4.9, 4.07692307692308, 6.11111111111111, 2.75, 8.375, 
    3.52, 3.83333333333333, 2.08333333333333, 4.5454, 2.66666666666667, 
    3.90909090909091, 3.38571428571429, 3.16666666666667, 6.8, 
    1.625, 8.125, 1.5, 3, 1.70588235294118, 3.46153846153846, 
    1.672, 4.15384, 3.16666666666667, 3.69230769230769, 3.5, 
    4.61538461538461, 6.26168224299065, 5.08333333333333, 3.25, 
    3.0625, 4.7, 2.03137254901961, 3.11764705882353, 4.77777, 
    3.2, 4.21428571428571, 4.87068965517241, 2.8, 5.81730769230769, 
    13.3636363636364, 8.42857142857143, 17.2926829268293, 2.3, 
    5.22222222222222, 2.222, 3.81818181818182, 2.63677130044843, 
    2.58333333333333, 2, 1.86666666666667, 2.695, 1.96153846153846, 
    5.14285714285714, 3.37096774193548, 3.6793893129771, 3.27777777777778, 
    3.5, 2.05555555555556, 2.08333333333333, 0.785977859778598, 
    4.25, 2.30827067669173, 16.6363636363636, 1.8, 1.09523, 4, 
    5.55555555555556, 3.45977011494253, 2.6153, 1.95238095238095, 
    0.211128048780488, 3.11111111111111, 0.896551724137931, 2.675, 
    5.46153846153846, 9.41, 5, 2.11764705882353, 4.14285714285714, 
    4.25, 4.33333333333333, 6.2, 5.75, 7.66666666666667, 2.21428571428571, 
    3.8125, 1.89406779661017, 3.64473684210526, 2, 8, 4.95081967213115, 
    2.93418851087563, 4.58333, 2.25, 2.46666666666667, 1.92307692307692, 
    3.68421052631579, 2.13215859030837, 3.22222222222222, 10.125, 
    3.4, 4.625, 1.42335766423358, 2.2032, 2.06015037593985, 5.53846153846154, 
    2.58823529411765, 3.16568047337278, 3.51492537313433, 3.5, 
    11, 1.14503816793893, 3, 1.66666666666667, 1.66666666666667, 
    2.37931034482759, 1.90123456790123, 1.76470588235294, 1.73684210526316, 
    3.77777777777778, 2.81818181818182, 2.53333333333333, 1.20179372197309, 
    3.45454545454545, 2.68421052631579, 2.30412371134021, 10, 
    4.0414201183432, 6.80645161290323, 10.4444444444444, 4.41666666666667, 
    1.08993288590604, 2.4375, 10.6, 2.19047619047619, 0.8, 2.09090909090909, 
    3.26666666666667, 2.33333333333333, 4, 2.35714285714286, 
    3.10526315789474, 3.38562091503268, 19.3333333333333, 3.37762237762238, 
    1.03980099502488, 2.01796407185629, 4.31578947368421, 2.75, 
    3.07692307692308, 1.79295154185022, 4, 2.61951219512195, 
    3.71428571428571, 3.66666666666667, 3, 5.63013698630137, 
    2.85792349726776, 3.05882, 4, 3.875, 3.63636363636364, 2.65, 
    5.57142857142857, 2.81818181818182, 3.5, 1.5420590081607, 
    1.94444444444444, 4.5, 4.14285714285714, 2.5, 3.1, 3.666, 
    2.95238095238095, 1.64516129032258, 12.75, 5.06363636363636, 
    2.09230769230769, 6.5, 2.13636363636364, 9, 3.42857142857143, 
    3.875, 1.58064516129032, 3.988, 1.46866485013624, 3.5, 3.73255813953488, 
    8, 4.08333333333333, 8.3687, 4.5, 3.31147540983607, 10.4545454545455, 
    2.66666666666667, 1.14814814814815, 3.42857142857143, 2.64285714285714, 
    3.95934959349594, 17.0769230769231, 3.5, 5.2, 4.259, 2.46666666666667, 
    6.54545454545454, 1.24137931034483, 11.28125, 2.94736842105263, 
    4.125, 6.23728813559322, 1.55364806866953, 1.01731601731602, 
    3.23076923076923, 1.66666666666667, 12.375, 1.75845410628019, 
    1.07509, 6.375, 27.5714285714286, 3.59763313609467, 2.43119266055046, 
    1.10330578512397, 5.36111111111111, 2.11353, 12.6029411764706, 
    4.23008849557522, 2.78571428571429, 6.15068493150685, 3.4848, 
    5.618, 4.53846153846154, 2.05, 5.90909090909091, 3.55555555555556, 
    6.08771929824561, 1.625, 5.84862692565305, 1.98224852071006, 
    4.93233082706767, 2.13636363636364, 1.86, 2.47773279352227, 
    5.75, 2.72727272727273, 3.73333333333333, 4, 2.084, 1.91959798994975, 
    6.47872340425532, 3, 7.66666667, 2.81081081081081, 5.66666666666667, 
    1.53846153846154, 5.22727272727273, 1.9236641221374, 4.01941747572816, 
    4.04761904761905, 1.31707317073171, 2.56209150326797, 4.42168674698795, 
    1.38888888888889, 2.08, 8.66666666666667, 3.11111111111111, 
    2.07407407407407, 2.08333333333333, 10.672131147541, 2.28571428571429, 
    22.75, 3.308, 3.32222222222222, 1.31277533039648, 3.16455696202532, 
    2.47549019607843, 12.625, 2.35714285714286, 3.92105263157895, 
    1.32600732600733, 6.554, 3.21111111111111, 2, 3.16666666666667, 
    4.48181818181818, 4.037, 2.61538461538462, 3.875, 3.25, 2.7, 
    3.27272727272727, 6.33333333333333, 3.7, 20.6666666666667, 
    9.88888888888889, 5, 3.5, 2.8181, 1.86666666666667, 3.6, 
    19.5625, 4.87943262411348)), row.names = c(NA, -591L), class = c("data.table", 
"data.frame"), .internal.selfref = <pointer: 0x000001b040f245d0>)

这是我的 R 代码:

library (sjPlot); library(dplyr)
A <- glm(  MAE ~ Plt,data=df,family = binomial);Publish::publish(A)
set_theme(base = theme_classic())
plot_model(A,  type = "pred", transform="exp",terms="Plt [all]",
           legend.title = "",axis.title = c(  "Plt (%)",  "Odds ratio"), 
           title = "Odds ratio of MAE in relation to Plt (%)", colors=c("navyblue"))

使用

glm
,我得到
odds ratio
大于 1,但绘图显示优势比`小于 1。

enter image description here enter image description here

我错过了什么吗? 请告诉我。任何帮助将不胜感激

r plot model sjplot
1个回答
0
投票

尝试省略

type
参数,或使用默认值(“est”):

plot_model(A, terms="Plt", type = "est", ...

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.