小编pre*_*ent的帖子

表示分析不起作用,疯狂的值和图表

我正在分析一个数据集,其中 y 值为蛋白质水平范围为 0-3.6nmol/L。我对线性模型进行了 sqrt 变换,并尝试进行事后测试,但我的 emmean 值和置信区间没有意义,特别是因为其中一个平均值以某种方式结果为负。

我这样初始化我的模型:

fasting.sqrt <- lm(sqrt(FCP) ~ Type * BMI_Percentile, data = Database_Mexican_children_with_different_types_of_DM)
Run Code Online (Sandbox Code Playgroud)

然后制作我的数据框以供事后专门查看类型:

fasting.sqrt.emm = emmeans(fasting.sqrt, specs="Type") %>% as.data.frame()
Run Code Online (Sandbox Code Playgroud)

返回这个:

# Type  emmean     SE  df lower.CL upper.CL
#  1     0.732 0.0980 129    0.538    0.926
#  2    -0.391 0.6511 129   -1.679    0.897
#  3     0.708 0.0728 129    0.564    0.852
#  4     0.260 0.8955 129   -1.512    2.032
Run Code Online (Sandbox Code Playgroud)

并且,使用此图形代码:

ggplot() + 
  geom_point(data=Database_Mexican_children_with_different_types_of_DM, aes(x=Type, y=FCP), alpha=0.3) +
  geom_errorbar(data=fasting.sqrt.emm, aes(x=Type, ymin=lower.CL*abs(lower.CL), ymax=(upper.CL)^2), width=0.1) +
  geom_point(data=fasting.sqrt.emm, aes(x=Type, y=emmean*abs(emmean)), 
             color="red", …
Run Code Online (Sandbox Code Playgroud)

r graph emmeans

4
推荐指数
1
解决办法
135
查看次数

标签 统计

emmeans ×1

graph ×1

r ×1