t

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

我是一个生物化学家,作为一个非专业的R工作,现在遇到一个问题。我有一个数据框,我想比较我的不同治疗组和阳性对照与中等对照。我想使用的统计检验是anova,然后是Dunnetts检验。我使用了 multcomp- 和 DescTools-包,然后我用这段代码达到目的

Particle <- factor(c("Medium", "PosCon", "Trt1", "Trt2", "Trt3", "Medium", "PosCon", "Trt1", "Trt2", "Trt3", "Medium", "PosCon", "Trt1", "Trt2", "Trt3"))
Values <- c(1.0, 263.0, 3.1, 1.2, 0.9, 1.0, 244.0, 2.4, 1.6, 1.1, 1.0, 255.0, 3.8, 2.0, 0.8)

myDataframe <- data.frame(Particle, Values)

str(myDataframe)

a1 <- aov(Values ~ Particle, data= myDataframe) 
summary(a1)

#Output
#            Df Sum Sq Mean Sq F value   Pr(>F)    
#Particle     4 152832   38208    2084 1.48e-14 ***
#Residuals   10    183      18                     
#---
#Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

myDataframe.dunnett <- glht(a1, linfct = mcp(Particle= "Dunnett"))
myDataframe.dunnett


summary(myDataframe.dunnett)
# Output:
#    Simultaneous Tests for General Linear Hypotheses
#
#Multiple Comparisons of Means: Dunnett Contrasts
#
#
#Fit: aov(formula = Values ~ Particle, data = myDataframe)
#
#Linear Hypotheses:
#                      Estimate Std. Error t value Pr(>|t|)    
#PosCon - Medium == 0 253.00000    3.49616  72.365   <0.001 ***
#Trt1 - Medium == 0     2.10000    3.49616   0.601    0.930    
#Trt2 - Medium == 0     0.60000    3.49616   0.172    0.999    
#Trt3 - Medium == 0    -0.06667    3.49616  -0.019    1.000    
#---
#Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#(Adjusted p values reported -- single-step method)

现在我想得到提取的p值(或Pr(>

r extract p-value posthoc
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.