问题标签 [lsmeans]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
r - 绘制边际均值和置信区间 R
我对 R 非常陌生,我正在尽力理解它,但目前我发现它使用起来很简单,因此我请求你的帮助。
我使用模型拟合
我计算 ls-means (或调整的手段)使用
如何绘制分组变量的均值(有错误的条形图)fixed2
并查看哪些组在统计上不同?
谢谢!
r - R: Tukey posthoc tests for nnet multinom multinomial fit to test for overall differences in multinomial distribution
I fitted a mutinomial model using nnet
's multinom
function using (in this case on data giving the diet preference of male and female and different size classes of alligators in different lakes) :
The overall significance of my factors I can get using
And effect plots I got e.g. for factor "lake" using
In addition to the overall Anova tests I would also like to also carry out pairwise Tukey posthoc tests though to test for overall differences in the multinomial distribution of which prey items are eaten, e.g. across different pairs of lakes.
I first thought of using function glht
in package multcomp
but this does not appear to work, e.g. for factor lake
:
Alternative was to use package lsmeans
for this, for which I tried
This carries out tests for differences in the proportion of each specific type of food item though.
I was wondering if it would also be possible in one way or another to obtain Tukey posthoc tests in which the overall multinomial distributions are compared across the different lakes, i.e. where differences are tested for in the proportion of any of the prey items eaten? I tried with
but that doesn't seem to work:
Any thoughts?
Or would anyone know how glht
could be made to work for multinom
models?
r - 从 R 中的线性模型估计预测值
给定一个回归模型:
y = b0 + b1(x)
其中 x 和 y 都是连续的。
拟合模型后,我想估计当 x 处于某个值(例如 100)时 y 的预测均值和 95%CI。
在 Stata 中,可以通过边距来实现:
在 SAS 中,可以通过估算来完成:
我的问题是:如何在 R 中实现相同的操作?我尝试了这个lsmeans
包,但如果我的模型中没有任何分类变量,它似乎不起作用。
r - 事后测试线性混合模型 lsmeans 错误
我有一个关于在线性混合模型上运行事后测试的问题:
我正在运行一个线性混合模型,分为lme4
3 组,每组 5 条蛇,每组以不同的通风率 ( Vent
),在不同时间点进行测量 ( Time
),将蛇指定为随机效应 ( ID
)
下面的数据子集:
代码:
通风效果测试:
与通风口比较:
测试时间的影响:
所以尝试事后测试:
这是我得到错误的地方:
我可以使用以下方法进行校正并运行成对测试:
但是知道这在其他变量有相互作用的情况下不起作用(就像我的其他数据一样),并且我希望在每个时间点和通风制度之间进行成对比较。这可能lsmeans()
吗?
感谢您的意见,我知道似然比测试本身是有争议的。我已经考虑过混合效应方差分析,但是有一些缺失的数据点使得这不可能。数据之前被另一名学生分析为双向方差分析,没有重复测量,但我的感觉是这不合适,因为每条蛇都是在重复的时间点测量的
r - lsmeans 的 SE 含义 type="response"
我试图在原始响应变量的尺度上绘制一个泊松模型。我的顾问希望我绘制大黄蜂产蛋的平均值 +/- SE。
使用“type="response"”时,我不明白“SE”术语的含义。在线性预测器的尺度上,CI 和 SE 关于均值对称。当手动对数据帧求幂时,CI 变得不对称,并将 lsmeans 的输出与“type="response"”匹配。但是,“SE”只有一列。为什么在从对数刻度转换(均值+/-SE)时没有 2 列来解释不对称性?谢谢你的帮助!
r - R LSmeans by group
有没有办法按组按 LSmean 值汇总数据框?在这个例子中,我有 3 个不同的研究,每一个都是 RCB 设计
简单的意味着值将是:
第一项研究的 LSmeans 值为:
我真的不知道是否可以一次完成所有操作,或者一个一个完成...提前致谢!
r - 在 R 中使用 Multcomp 进行计划对比度
我有一个我想进行的分析,我已经计划了对比(不是事后比较!)我想在治疗组之间进行。治疗组变量有 (k =) 4 个水平。我计划总共进行 3 次不同的比较,因此,如果我理解正确的话,我不需要对计算的 p 值进行任何调整,因为比较是 k-1。
我想在 R 中使用multcomp
orlsmeans
包来做到这一点。我的问题是:有谁知道是否可以在不对置信区间(和 p 值)进行任何调整的情况下进行这种计划比较?据我从我看过的小插图和我看过的例子中可以看出,该summary.glht()
功能会作为默认值进行调整,我不清楚哪个选项会撤消此操作。
如果有人需要一个可重现的例子,他们可以使用我在http://www.ats.ucla.edu/stat/r/faq/testing_contrasts.htm上找到的这个例子:
r - 如何提取LSMEANS的置信限?
我正在使用oranges
lsmeans 提供的数据。
置信区间可以通过绘图来可视化plot(contrast(days.lsm, "trt.vs.ctrl", ref = c(5,6)))
,但它们不会显示在days_contr.lsm
如何将置信区间提取到 data.frame?