假设方差相等的方差对比的单因素分析和协方差分析

2024-02-16 10:02   上海  


01
One-Way ANOVA


单向(多组)设计允许比较两个或多个总体(组)的均值以确定是否至少一个均值与其他均值不同。F 检验用于确定统计显著性。

F-Test

         

 

通常的 F 检验检验所有均值相等的假设与至少一个均值与其他均值不同的备选方案。通常,需要更具体的替代方案。例如,您可能想要检验治疗均值是否与对照均值不同,低剂量是否与高剂量不同,不同剂量水平是否存在线性趋势,等等。这些问题使用特定的对比进行检验。       

 

比较是均值的加权平均值,其中权重可能为负数。当权重总和为零时,比较称为对比。       

 

    

例如,假设为研究药物而进行的实验将具有三种剂量水平:空白(对照)、20 mg 和 40 mg。第一个问题是药物是否有所不同。如果是这样,接受药物的两组的平均反应应该与对照组不同。如果我们将组标记为 M0、M2 和 M4,我们有兴趣将 M0 与 M2 和 M4 进行比较。这可以通过两种方式完成。一种方法是构建两个检验,一个比较 M0 和 M2,另一个比较 M0 和 M4。另一种方法是进行一项检验,将 M0 与 M2 和 M4 的平均值进行比较。这些检验是使用对比进行的。系数如下:

M0 vs. M2

要比较 M0 与 M2,请使用系数 -1、1、0。当应用于群均值时,这些系数导致比较 M0(-1) + M2(1) + M4(0),从而简化为 M2-M0。也就是说,这种对比导致两个组均值之间的差值。我们可以使用 t 检验(或 F检验,因为 t 检验的平方是 F 检验)来检验这种差值是否为非零。

M0 vs. M4

要比较 M0 与 M4,请使用系数 -1、0、1。当应用于群均值时,这些系数导致比较 M0(-1) + M2(0) + M4(1),简化为 M4 - M0。也就是说,这种对比导致

两组均值之间的差异。

M0 vs. Average of M2 and M4

要将 M0 与 M2 和 M4 的平均值进行比较,请使用系数 -2、1、1。当应用于组

均值时,这些系数导致比较 M0(-2) + M2(1) + M4(1),相当于 M4 + M2 -

2(M0)。

Assumptions

使用 F 检验需要某些假设。F检验受欢迎的原因之一是它在面对假设违规时的稳健性。但是,如果假设甚至不能近似满足,则 F 检验的显著性水平和功效将失效。不幸的是,在实践中,经常会出现几个假设没有得到满足的情况。这让事情变得更糟。因此,在做出重要决策之前,应采取措施检查假设。             

 

单因素方差分析的假设为:

1.数据是连续的(不是离散的).

2.数据服从正态概率分布。每个组的正态分布约为组均值

3.组内的方差相等。

4.这些组是独立的。一个群体中的个体与另一个群体之间没有关系

5.每个组都是从其总体中随机抽取的简单样本。总体的每个个体在样本中被选中的概率相等。

Technical Details for One-Way ANOVA Contrasts

Power Calculations for Contrasts         

 

    

Contrast Producing the Maximum Power

Example

An experiment is being designed to compare the means of four groups using a two-sided contrast test with a significance level of 0.05. The first group is a control group. The other three groups will have slightly different treatments applied. The researchers are mainly interested in whether the three treatment groups are different from the control group. Hence, they want to test the contrast represented by the coefficients {3, 1, 1, 1}. Treatment means {40, 10, 10, 10} represent clinically important group differences. Previous studies have had standard deviations between 18 and 21 and 24 . To better understand the relationship between power and sample size, the researcher wants to compute the power for several group sample sizes between 2 and 14. The sample sizes will be equal across all groups.

第一步:参数录入,但我们只模拟标准差是18的情况。    

第二步:结果输出    

分配模式 {3, 1, 1, 1} 需要最小受试者数。该模式将 50% 分配给第一组(对照组),并将剩余的 50% 均匀分布在三个治疗组中。也许这种最优性之所以发生,是因为被测试的对比度具有系数{-3, 1, 1, 1}。    

         

 

Continuation of Example 1. An experiment is being designed to compare the means of four groups using a two-sided contrast test with a significance level of 0.05. The first group is a control group. The other three groups will have slightly different treatments applied. The researchers are mainly interested in whether the three treatment groups are different from the control group. Hence, they want to test the contrast represented by the coefficients {3, 1, 1, 1}. Treatment means {40, 10, 10, 10} represent clinically important group differences. Previous studies have had standard deviations between 18 and 24.

The researchers want to compare the sample size requirements for various sample allocation patterns: {1,1, 1, 1}, {2, 1, 1, 1}, {3, 1, 1, 1}, {4, 1, 1, 1}. As you can see, these patterns allocate a progressively portion of the available participants to the control group. These patterns are entered into the spreadsheet as follows.    

第一步:参数录入

         

 

02
ANCOVA


协方差分析 (ANCOVA) 是单因素方差分析模型的扩展,该模型添加了定量变量(协变量)。使用时,假设它们的加入将减小误差方差的大小,从而增加设计的Power。        

 

   

除了单因素方差分析需要满足上文提到的5个假设,协方差分析需要额外的假设:

1.协变量与响应变量呈线性关系。

2.协变量和响应变量之间的这些线性关系的斜率在所有组中近似相等。

Technical Details for ANCOVA

我们发现了两种略有不同的计算能力公式,用于分析协方差。         

 

Keppel(1991)给出的结果是,由于协变量,标准差的修正量与其减少量成正比。         

 

Borm et al. (2007) 给出的结果使用非中心 F 分布的正态近似。

   

计划的过程应包括以下步骤:

1.确定组内标准差的估计值,σ。这可以通过先前的研究、标准差估计模块的实验、试点研究或基于数据范围的粗略估计来完成。

2.确定一组表示要检测的组差异的均值。

3.确定响应和协变量之间的 R 平方值。

4.确定适当的组样本量,以确保所需的α和β水平。

Power Calculations for ANCOVA

(ANCOVA) Contrasts

假设每个 G 组都具有正态分布和相等的均值 (μ1 = μ2 = ⋯ = μG)。设 n1 = n2 =

⋯ = nG 表示每组的受试者数,设 N 表示所有组的总样本量。设 σ 表示所有组的共同标准差。比较是均值的加权平均值,其中权重可能为负。当权重总和为零时,比较称为对比。此过程提供了ANCOVA设计中使用的对比度的结果。    

Test Statistic

 

Power Calculations for Contrasts    

         

 

 

Take home message:

1.除了ANOVA需要满足上文提到的5个假设,ANCOVA需要额外的假设:协变量与响应变量呈线性关系;协变量和响应变量之间的这些线性关系的斜率在所有组中近似相等。

2. ANOVA比较是均值的加权平均值,其中权重可能为负数。当权重总和为零时,比较称为对比。

3. ANCOVA对比系数输入类型选择输入对比度系数的方式

Contrast Definition

A contrast is a weighted average of the group means in which the weights sum to zero. For example, suppose you are studying four groups and that the main hypothesis of interest is whether there is a linear trend across the groups. You would enter "-0.75, -0.25, 0.25,及 0.75" here. This would form the weighted average of the means:         

 

-0.75 μ1 -0.25 μ2 + 0.25 μ3 + 0.75 μ4         

 

The point to realize is that these weights (the coefficients) are used to calculate a specific weighted average of the means which is to be compared against zero using a standard t test. Hence, G coefficients (weights) must be defined.         

 

These coefficients must sum to zero. Also, the scale of the coefficients does not matter. That is the powers of "-1 0.5 0.5", "-2 1 1", and "-200 100 100" are the same.    

Coefficients Sum to Two    

Kirk(2013) recommends that Σ|ci| = 2, where ci is the coefficient of the contrast associated with the ith group, so that magnitudes of different contrasts can be compared.         

 

Possible options         

 

·List of Contrast Coefficients

Enter a list of coefficients, separated by commas or blanks.         

 

·Columns Containing Contrasts

Enter several contrasts, one per column, on the spreadsheet. Each contrast is entered down a column, one coefficient per row.         

 

·First Group vs Rest

A contrast is generated appropriate for testing that the mean of the first group is different from the average of the remaining groups. For example, if there were four groups, the generated coefficients would be "-1, 1/3, 1/3, 1/3".         

 

·Last Group vs Rest

A contrast is generated appropriate for testing that the log mean of the last group is different from the average log value of the remaining groups. For example, if there were four groups, the generated coefficients would be "1/3, 1/3, 1/3, -1".         

 

·Linear Trend

A set of coefficients is generated appropriate for testing the alternative hypothesis that there is a linear (straight-line) trend across the group means. These coefficients assume that the groups are equally spaced across some unspecified, quantitative variable associated with the groups.         

 

         

 

参考文献:

PASS说明书    

流行病学与卫生统计学
Pivot数据交流平台,每周分享临床试验研究设计、实施、统计等相关信息。
 最新文章