1

我有一个我想进行的分析,我已经计划了对比(不是事后比较!)我想在治疗组之间进行。治疗组变量有 (k =) 4 个水平。我计划总共进行 3 次不同的比较,因此,如果我理解正确的话,我不需要对计算的 p 值进行任何调整,因为比较是 k-1。

我想在 R 中使用multcomporlsmeans包来做到这一点。我的问题是:有谁知道是否可以在不对置信区间(和 p 值)进行任何调整的情况下进行这种计划比较?据我从我看过的小插图和我看过的例子中可以看出,该summary.glht()功能会作为默认值进行调整,我不清楚哪个选项会撤消此操作。

如果有人需要一个可重现的例子,他们可以使用我在http://www.ats.ucla.edu/stat/r/faq/testing_contrasts.htm上找到的这个例子:

    library(multcomp)

    hsb <- read.csv("http://www.ats.ucla.edu/stat/data/hsb2.csv")

    m1 <- lm(read ~ socst + factor(ses) * factor(female), data = hsb)
    summary(m1)

    K <- matrix(c(0, 0, 1, -1, 0, 0, 0), 1)
    t <- glht(m1, linfct = K)
    summary(t)
4

1 回答 1

1

就我看到你的例子而言,你的问题有点奇怪。至少IMO,如果你不需要调整,你不需要使用multcomp包(但在某些情况下,它可以节省我们一些时间)。

library(multcomp)
hsb <- read.csv("http://www.ats.ucla.edu/stat/data/hsb2.csv")
hsb$ses <- as.factor(hsb$ses)

m3 <- lm(read ~ socst + ses, data = hsb)
l3 <- glht(m3, linfct = mcp(ses = "Tukey"))

# mcp(~) doesn't run with some type of model. If so, you'll give the matrix directly.
# k3 <- matrix(c(0, 0, 1, 0,
#                0, 0, 0, 1,
#                0, 0, -1, 1), byrow = T, ncol = 4)
# rownames(k3) <- c("2-1", "3-1", "3-2")
# l3 <- glht(m3, linfct = k1)

summary(l3, test=adjusted("none"))    # this is the result without adjustment
#            Estimate Std. Error t value Pr(>|t|)
# 2 - 1 == 0   0.6531     1.4562   0.448    0.654
# 3 - 1 == 0   2.7034     1.6697   1.619    0.107
# 3 - 2 == 0   2.0503     1.3685   1.498    0.136

hsb$ses <- relevel(hsb$ses, ref="2")  # change of the order of levels
m3.2 <- lm(read ~ socst + ses, data = hsb)
summary(m3)     # "Without adjustment" means it's equivalent to original model's statistics.
#             Estimate Std. Error t value Pr(>|t|)
#  :
# ses2         0.65309    1.45624   0.448    0.654    
# ses3         2.70342    1.66973   1.619    0.107 

summary(m3.2)
#             Estimate Std. Error t value Pr(>|t|)
#  :
# ses3         2.05033    1.36846   1.498    0.136

# When argument is lmer.obj, summary(~, adjusted("none")) returns p.value by using z value with N(0, 1).
于 2016-06-24T16:51:53.757 回答