- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有固定效应的数据:genotypes = C, E, K, M;年龄 = 30、45、60、75、90 天;随机效应: block = 1、2、3;和变量 = weight_DM。
文件位于:https://drive.google.com/open?id=1_H6YZbdesK7pk5H23mZtp5KhVRKz0Ozl
我有每种基因型的线性斜率和年龄的二次斜率,但我没有截距和标准误差。 R代码是:
library(nlme)
library(lme4)
library(car)
library(carData)
library(emmeans)
library(ggplot2)
library(Matrix)
library(multcompView)
datos_weight <- read.csv2("D:/investigacion/publicaciones/articulos-escribiendo/pennisetum/pennisetum-agronomicas/data_weight.csv",header=T, sep = ";", dec = ",")
parte_fija_3 <- formula(weight_DM
~ Genotypes
+ Age
+ I(Age^2)
+ Genotypes*Age
+ Genotypes*I(Age^2))
heterocedasticidad_5 <- varComb(varExp(form = ~fitted(.)))
correlacion_4 <- corCompSymm(form = ~ 1|Block/Genotypes)
modelo_43 <- gls(parte_fija_3,
weights = heterocedasticidad_5,
correlation = correlacion_4,
na.action = na.omit,
data = datos_weight)
anova(modelo_43)
#response
Denom. DF: 48
numDF F-value p-value
(Intercept) 1 597.3828 <.0001
Genotypes 3 2.9416 0.0424
Age 1 471.6933 <.0001
I(Age^2) 1 22.7748 <.0001
Genotypes:Age 3 5.9425 0.0016
Genotypes:I(Age^2) 3 0.7544 0.5253
#################################
#test whether the linear age slopes of each genotype is equal to zero
################################
(tendencias_em_lin <- emtrends(modelo_43,
"Genotypes",
var = "Age"))
#response
Genotypes Age.trend SE df lower.CL upper.CL
C 1.693331 0.2218320 48 1.247308 2.139354
E 1.459517 0.2135037 48 1.030239 1.888795
K 2.001097 0.2818587 48 1.434382 2.567811
M 1.050767 0.1301906 48 0.789001 1.312532
Confidence level used: 0.95
(tendencias_em_lin_prueba <- update(tendencias_em_lin,
infer = c(TRUE,TRUE),
null = 0))
#response
Genotypes Age.trend SE df lower.CL upper.CL t.ratio p.value
C 1.693331 0.2218320 48 1.247308 2.139354 7.633 <.0001
E 1.459517 0.2135037 48 1.030239 1.888795 6.836 <.0001
K 2.001097 0.2818587 48 1.434382 2.567811 7.100 <.0001
M 1.050767 0.1301906 48 0.789001 1.312532 8.071 <.0001
Confidence level used: 0.95
########################################
#test differences between slope of the age linear for each genotype
########################################
CLD(tendencias_em_lin,
adjust = "bonferroni",
alpha = 0.05)
#response
Genotypes Age.trend SE df lower.CL upper.CL .group
M 1.050767 0.1301906 48 0.7128801 1.388653 1
E 1.459517 0.2135037 48 0.9054057 2.013628 12
C 1.693331 0.2218320 48 1.1176055 2.269057 12
K 2.001097 0.2818587 48 1.2695822 2.732611 2
Confidence level used: 0.95
Conf-level adjustment: bonferroni method for 4 estimates
P value adjustment: bonferroni method for 6 tests
significance level used: alpha = 0.05
问题
感谢您的帮助。
最佳答案
您可以使用 emmeans()
以与使用 emtrends()
类似的方式来回答这些问题。
另请查看 summary.emmGrid
的文档,注意您可以选择是否执行 CI、测试或两者。例如,
emm <- emmeans(...)
summary(emm, infer = c(TRUE,TRUE))
summary(emm, infer = c(TRUE,FALSE)) # or confint(emm)
summary(emm, infer = c(FALSE,TRUE)) # or test(emm)
如果实际上你想要实际的 y 截距,你可以使用
emm <- emmeans(..., at = list(age = 0))
预测是在 0 岁时做出的,这是每组条件的回归方程中的截距。但是,我想劝阻你这样做,因为 (a) 这些预测是巨大的外推,因此它们的标准误差也很大; (b) 预测 0 岁时的 react 没有实际意义。因此,我认为问题 #1 基本上没有意义。
如果您将 at
部分排除在外,则 emmeans()
会在数据集中的平均年龄进行预测。这些预测的标准误差远比截距小。由于您在模型中有涉及 age
的交互,因此每个年龄段的预测比较不同。我建议放
emm <- emmeans(..., cov.reduce = FALSE, by = "age")
这等效于使用 at
指定数据集中出现的一组 age
值,并对每个年龄值进行单独比较。
关于r - R 的一般混合线性模型中截距的假设检验,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52866203/
这是我第一次提问,对于任何格式问题或任何让我难以回答的问题,我深表歉意。请让我知道我需要添加什么才能回答问题。 我正在尝试比较 2 个不相等的组大小(一个 ~ 97,另一个 ~ 714)之间的差异。差
这个问题在这里已经有了答案: dplyr summarize across ttest (1 个回答) 关闭 5 个月前。 我有这样的数据框 X1 X2 X3 X4 X5 class 1 1
我正在尝试对数据框中的两个数据子集运行 wilcox.test()。它们的长度不相等(48 对 260)。我想看看活橡树和水橡树的 dbh(胸高直径)是否存在差异。 Pine_stand 并收到该错
我有一个带有两个级别的因子列和许多数字列的数据框。我想按因子列拆分数据帧并对列对进行 t 检验。 使用示例数据集 Puromycin 我希望结果看起来像这样: Variable Treated
我尝试对数据框的所有列(一次两列)进行 t 检验,并仅提取 p 值。这是我想出的: for (i in c(5:525) ) { t_test_p.value =sapply( Data[5:525]
我有一个有 11 列数据的 Pandas 。我想通过测试将每一列与其他每一列进行比较(见下文)。如何创建一个循环来自动比较所有列,而无需为每个列对组合手动编写代码? from scipy.stats
我有一些数据,如下所示: # Groups: date [4] date data 1 2021-01-31 2 20
这就是我的数据的样子: > dput(data) structure(list(Name = c("Mark", "Tere", "Marcus", "Heidi", "Georg", "Tieme"
我有一个有 11 列数据的 Pandas 。我想通过测试将每一列与其他每一列进行比较(见下文)。如何创建一个循环来自动比较所有列,而无需为每个列对组合手动编写代码? from scipy.stats
我有一些数据,如下所示: # Groups: date [4] date data 1 2021-01-31 2 20
所以我有一些股票价格数据,我想测试价格是否遵循对数正态分布。我的代码如下: import scipy.stats as stats print(stats.kstest(df['DJIA'], "lo
我想对我的固定效应回归系数进行简单的联合 Wald 检验,但我想将限制设置为非零值。更具体地说,我想测试:H0: ai=0 and b=1 for every i或者基本上,是否从固定效应模型 (ai
我正在尝试进行双样本 t 检验,以检查两个数据集之间的均值是否存在显着差异。 我有两个数据集,每个数据集有 5 个试验,每个试验有 3 个特征。每个 Trial 都有不同的唯一标签,但 3 个特征(X
考虑以下虚拟数据: x <- rnorm(15,mean = 3,sd = 1) y <- rnorm(15,mean = 3,sd = 1) xy <- c(x,y) factor <- c(rep
我是一名计算机科学专业的学生,我正在自学算法类(class)。 在类(class)中我看到了这个问题: Show an efficient randomized algorithm to fact
我想使用拟合我的数据的 f 检验来比较两个模型。对于每个模型,我都执行了蒙特卡洛模拟,为每个模型参数和均方根拟合误差提供了统计估计。我想在 R 中使用 f-test 来确定哪个模型更可取。 最佳答案
我很难让 ks.test 使用卡方分布式数据: > chi10 ks.test(chi10, dchisq, df=10) One-sample Kolmogorov-Smirnov tes
我试图在 R 中复制 SPSS 的线性判别分析输出,但我很难找到执行 m-box 测试的方法。 我唯一找到的是一些发布在论坛上的代码,用于手动实现该过程,但我想知道语言本身是否已经包含用于此目的的任何
我有以下数据框: structure(list(test1 = c(0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1), test2 = c(0, 0, 1, 1, 0,
标准 stats::kruskal.test 模块允许计算数据集上的 kruskal-wallis 测试: >>> data(diamonds) >>> kruskal.test(price~cara
我是一名优秀的程序员,十分优秀!