Chapter page 31 / 3823 Applications: Infer
English

23  Applications: Infer

23.1 Recap: Computational methods

The computational methods we have presented are used in two settings. First, in many real life applications (as in those covered here), the mathematical model and computational model give identical conclusions. When there are no differences in conclusions, the advantage of the computational method is that it gives the analyst a good sense for the logic of the statistical inference process. Second, when there is a difference in the conclusions (seen primarily in methods beyond the scope of this text), it is often the case that the computational method relies on fewer technical conditions and is therefore more appropriate to use.

23.1.1 Randomization

An important feature of randomization tests is that the data are permuted in such a way that the null hypothesis is true. The randomization distribution provides a distribution of the statistic of interest under the null hypothesis, which is exactly the information needed to calculate a p-value — where the p-value is the probability of obtaining the observed data or more extreme when the null hypothesis is true. Although there are ways to adjust the randomization for settings other than the null hypothesis being true, they are not covered in this book and they are not used widely. In approaching research questions with a randomization test, be sure to ask yourself what the null hypothesis represents and how it is that permuting the data is creating different possible null data representations.

Hypothesis tests. When using a randomization test, we proceed as follows:

  • Write appropriate hypotheses.

  • Compute the observed statistic of interest.

  • Permute the data repeatedly, each time, recalculating the statistic of interest.

  • Compute the proportion of times the permuted statistics are as extreme as or more extreme than the observed statistic, this is the p-value.

  • Make a conclusion based on the p-value, and write the conclusion in context and in plain language so anyone can understand the result.

23.1.2 Bootstrapping

Bootstrapping, in contrast to randomization tests, represents a proxy sampling of the original population. With bootstrapping, the analyst is not forcing the null hypothesis to be true (or false, for that matter), but instead, they are replicating the variability seen in taking repeated samples from a population. Because there is no underlying true (or false) null hypothesis, bootstrapping is typically used for creating confidence intervals for the parameter of interest. Bootstrapping can be used to test particular values of a parameter (e.g., by evaluating whether a particular value of interest is contained in the confidence interval), but generally, bootstrapping is used for interval estimation instead of testing.

Confidence intervals. The following is how we generally computed a confidence interval using bootstrapping:

  • Repeatedly resample the original data, with replacement, using the same sample size as the original data.

  • For each resample, calculate the statistic of interest.

  • Calculate the confidence interval using one of the following methods:

    • Bootstrap percentile interval: Obtain the endpoints representing the middle (e.g., 95%) of the bootstrapped statistics. The endpoints will be the confidence interval.

    • Bootstrap standard error (SE) interval: Find the SE of the bootstrapped statistics. The confidence interval will be given by the original observed statistic plus or minus some multiple (e.g., 2) of SEs.

  • Put the conclusions in context and in plain language so even non-statisticians and data scientists can understand the results.

23.2 Recap: Mathematical models

The mathematical models which have been used to produce inferential analyses follow a consistent framework for different parameters of interest. As a way to contrast and compare the mathematical approach, we offer the following summaries in Table 23.1 and Table 23.2.

23.2.1 z-procedures

Generally, when the response variable is categorical (or binary), the summary statistic is a proportion and the model used to describe the proportion is the standard normal curve (also referred to as a \(z\)-curve or a \(z\)-distribution). We provide Table 23.1 partly as a mechanism for understanding \(z\)-procedures and partly to highlight the extremely common usage of the \(z\)-distribution in practice.

Table 23.1: Similarities of z-methods across one sample and two independent samples analysis of a binary response variable. \(p\) represents the population proportion, \(\hat{p}\) represents the sample proportion, \(p_0\) represents the null hypothesized proportion, \(\hat{p}_{pool}\) represents the pooled proportion, and \(n\) represents the sample size. The subscripts of 1 and 2 indicate that the values are measured separately for samples 1 and 2.
One sample Two independent samples
Response variable Binary Binary
Parameter of interest Proportion: \(p\) Difference in proportions: \(p_1 - p_2\)
Statistic of interest Proportion: \(\widehat{p}\) Difference in proportions: \(\widehat{p}_1 - \widehat{p}_2\)
Standard error: HT \(\sqrt{\frac{p_0(1-p_0)}{n}}\) \(\sqrt{\widehat{p}_{pool}\bigg(1-\widehat{p}_{pool}\bigg)\bigg(\frac{1}{n_1} + \frac{1}{n_2}}\bigg)\)
Standard error: CI \(\sqrt{\frac{\widehat{p}(1-\widehat{p})}{n}}\) \(\sqrt{\frac{\widehat{p}_{1}(1-\widehat{p}_{1})}{n_1} + \frac{\widehat{p}_{2}(1-\widehat{p}_{2})}{n_2}}\)
Conditions 1. Independence, 2. Success-failure 1. Independence, 2. Success-failure

Hypothesis tests. When applying the \(z\)-distribution for a hypothesis test, we proceed as follows:

  • Write appropriate hypotheses.

  • Verify conditions for using the \(z\)-distribution.

    • One-sample: the observations (or differences) must be independent. The success-failure condition of at least 10 success and at least 10 failures should hold.
    • For a difference of proportions: each sample must separately satisfy the success-failure conditions, and the data in the groups must also be independent.
  • Compute the point estimate of interest and the standard error.

  • Compute the Z score and p-value.

  • Make a conclusion based on the p-value, and write a conclusion in context and in plain language so anyone can understand the result.

Confidence intervals. Similarly, the following is how we generally computed a confidence interval using a \(z\)-distribution:

  • Verify conditions for using the \(z\)-distribution. (See above.)
  • Compute the point estimate of interest, the standard error, and \(z^{\star}.\)
  • Calculate the confidence interval using the general formula:
    point estimate \(\pm\ z^{\star} SE.\)
  • Put the conclusions in context and in plain language so even non-statisticians and data scientists can understand the results.

23.2.2 t-procedures

With quantitative response variables, the \(t\)-distribution was applied as the appropriate mathematical model in three distinct settings. Although the three data structures are different, their similarities and differences are worth pointing out. We provide Table 23.2 partly as a mechanism for understanding \(t\)-procedures and partly to highlight the extremely common usage of the \(t\)-distribution in practice.

Table 23.2: Similarities of \(t\)-methods across one sample, paired sample, and two independent samples analysis of a numeric response variable. \(\mu\) represents the population mean, \(\bar{x}\) represents the sample mean, \(s\) represents the standard deviation, and \(n\) represents the sample size. The subscript of \(diff\) indicates that the values are measured on the paired differences. The subscripts of \(1\) and \(2\) indicate that the values are measured separately on sample \(1\) and sample \(2\).
One sample Paired samples Two independent samples
Response variable Numeric Numeric Numeric
Parameter of interest Mean: \(\mu\) Paired mean: \(\mu_{diff}\) Difference in means: \(\mu_1 - \mu_2\)
Statistic of interest Mean: \(\bar{x}\) Paired mean: \(\bar{x}_{diff}\) Difference in means: \(\bar{x}_1 - \bar{x}_2\)
Standard error \(\frac{s}{\sqrt{n}}\) \(\frac{s_{diff}}{\sqrt{n_{diff}}}\) \(\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}\)
Degrees of freedom \(n-1\) \(n_{diff} -1\) \(\min(n_1 -1, n_2 - 1)\)
Conditions 1. Independence, 2. Normality or large samples 1. Independence, 2. Normality or large samples 1. Independence, 2. Normality or large samples

Hypothesis tests. When applying the \(t\)-distribution for a hypothesis test, we proceed as follows:

  • Write appropriate hypotheses.

  • Verify conditions for using the \(t\)-distribution.

    • One-sample or differences from paired data: the observations (or differences) must be independent and nearly normal. For larger sample sizes, we can relax the nearly normal requirement, e.g., slight skew is okay for sample sizes of 15, moderate skew for sample sizes of 30, and strong skew for sample sizes of 60.
    • For a difference of means when the data are not paired: each sample mean must separately satisfy the one-sample conditions for the \(t\)-distribution, and the data in the groups must also be independent.
  • Compute the point estimate of interest, the standard error, and the degrees of freedom. For \(df,\) use \(n-1\) for one sample, and for two samples use either statistical software or the smaller of \(n_1 - 1\) and \(n_2 - 1.\)

  • Compute the T score and p-value.

  • Make a conclusion based on the p-value, and write a conclusion in context and in plain language so anyone can understand the result.

Confidence intervals. Similarly, the following is how we generally computed a confidence interval using a \(t\)-distribution:

  • Verify conditions for using the \(t\)-distribution. (See above.)
  • Compute the point estimate of interest, the standard error, the degrees of freedom, and \(t^{\star}_{df}.\)
  • Calculate the confidence interval using the general formula: \[\mbox{point estimate } \pm\ t_{df}^{\star} SE.\]
  • Put the conclusions in context and in plain language so even non-statisticians and data scientists can understand the results.

23.3 Case study: Redundant adjectives

Take a look at the images in Figure 23.1. How would you describe the circled item in Figure 23.1 (a)? Would you call it “the triangle”? Or “the blue triangle”? How about in Figure 23.1 (b)? Does your answer change?

Four shapes are presented twice. In the first set the shapes and colors are all different -- pink circle, yellow square, red diamond, blue triangle. In the second set the colors are all different but the triangle shape is repeated -- pink circle, yellow square, red triangle, blue triangle. In each set, the blue triangle is circled.
(a) The circled triangle is the only triangle.
Four shapes are presented twice. In the first set the shapes and colors are all different -- pink circle, yellow square, red diamond, blue triangle. In the second set the colors are all different but the triangle shape is repeated -- pink circle, yellow square, red triangle, blue triangle. In each set, the blue triangle is circled.
(b) The circled triangle is the only blue triangle.
Figure 23.1: Two sets of four shapes.

In Figure 23.1 (a) the circled item is the only triangle, but in the bottom image the circled item is one of two triangles. While in Figure 23.1 (a) “the triangle” is a sufficient description for the circled item, many of us might choose to refer to it as the “blue triangle” anyway. In Figure 23.1 (a) there are two triangles, so “the triangle” is no longer sufficient, and to describe the circled item we must qualify it with the color as well, as “the blue triangle”.

Your answers to the above questions might be different if you’re answering in a different language than English. For example, in Spanish, the adjective comes after the noun (e.g., “el triángulo azul”) therefore the incremental value of the additional adjective might be different for Figure 23.1 (a).

Researchers studying frequent use of redundant adjectives (e.g., referring to a single triangle as “the blue triangle”) and incrementality of language processing designed an experiment where they showed the following two images to 22 native English speakers (undergraduates from University College London) and 22 native Spanish speakers (undergraduates from the Universidad de las Islas Baleares). They found that in both languages, the subjects used more redundant color adjectives in denser displays where it would be more efficient. (Rubio-Fernandez et al. 2021) One of the displays from the study is shown in Figure 23.2.

Two presentations of shapes. In each presentation all of the shapes and their colors are unique. In the left presentation, the blue triangle is circled and is one of four shapes. In the right presentation, the blue triangle is circled and is one of sixteen shapes.
Figure 23.2: Images used in one of the experiments described in Rubio-Fernandez et al. (2021).

In this case study we will examine data from redundant adjective study, which the authors have made available on Open Science Framework at osf.io/9hw68.

Table 23.3 shows the top six rows of the data. The full dataset has 88 rows. Remember that there are a total of 44 subjects in the study (22 English and 22 Spanish speakers). There are two rows in the dataset for each of the subjects: one representing data from when they were shown an image with 4 items on it and the other with 16 items on it. Each subject was asked 10 questions for each type of image (with a different layout of items on the image for each question). The variable of interest to us is redundant_perc, which gives the percentage of questions the subject used a redundant adjective to identify “the blue triangle”. Note that the variable is “percentage”, and we are interested in the average percentage. Therefore, we will use methods for means. If the variable had been “success or failure” (e.g., “used redundant or didn’t”), we would have used methods for proportions.

Table 23.3: Top six rows of the data collected in the study.
language subject items n_questions redundant_perc
English 1 4 10 100
English 1 16 10 100
English 2 4 10 0
English 2 16 10 0
English 3 4 10 100
English 3 16 10 100

23.3.1 Exploratory analysis

In one of the images shown to the subjects, there are 4 items, and in the other, there are 16 items. In each of the images the circled item is the only triangle, therefore referring to it as “the blue triangle” or as “el triángulo azul” is considered redundant. If the subject’s response was “the triangle”, they were recorded to have not used a redundant adjective. If the response was “the blue triangle”, they were recorded to have used a redundant adjective. Figure 23.3 shows the results of the experiment. We can see that English speakers are more likely than Spanish speakers to use redundant adjectives, and that in both languages, subjects are more likely to use a redundant adjective when there are more items in the image (i.e., in a denser display).

Results of redundant adjective usage experiment from @rubio-fernandez2021. English speakers are more likely than Spanish speakers to use redundant adjectives, regardless of number of items in image. For both images, respondents are more likely to use a redundant adjective when there are more items in the image.
Figure 23.3: Results of redundant adjective usage experiment from Rubio-Fernandez et al. (2021). English speakers are more likely than Spanish speakers to use redundant adjectives, regardless of number of items in image. For both images, respondents are more likely to use a redundant adjective when there are more items in the image.

23.3.2 Confidence interval for a single mean

In this experiment, the average percentage of redundant adjective usage among subjects who responded in English when presented with an image with 4 items in it is 37.27. Along with the sample average as a point estimate, however, we can construct a confidence interval for the true mean redundant adjective usage of English speakers who use redundant color adjectives when describing items in an image that is not very dense.

Using a computational method, we can construct the interval via bootstrapping. Figure 23.4 shows the distribution of 1,000 bootstrapped means from this sample. The 95% confidence interval (that is calculated by taking the 2.5th and 97.5th percentile of the bootstrap distribution is 19.1% to 56.4%. Note that this interval for the true population parameter is only valid if we can assume that the sample of English speakers are representative of the population of all English speakers.

Distribution of 1,000 bootstrapped means of redundant adjective usage percentage among English speakers who were shown four items in images. Overlaid on the distribution is the 95% bootstrap percentile interval that ranges from 19.1% to 56.4%.
Figure 23.4: Distribution of 1,000 bootstrapped means of redundant adjective usage percentage among English speakers who were shown four items in images. Overlaid on the distribution is the 95% bootstrap percentile interval that ranges from 19.1% to 56.4%.

Using a similar technique, we can also construct confidence intervals for the true mean redundant adjective usage percentage for English speakers who are shown dense (16 item) displays and for Spanish speakers with both types (4 and 16 items) displays. However, these confidence intervals are not very meaningful to compare to one another as the interpretation of the “true mean redundant adjective usage percentage” is quite an abstract concept. Instead, we might be more interested in comparative questions such as “Does redundant adjective usage differ between dense and sparse displays among English speakers and among Spanish speakers?” or “Does redundant adjective usage differ between English speakers and Spanish speakers?” To answer either of these questions we need to conduct a hypothesis test.

23.3.3 Paired mean test

Let’s start with the following question: “Do the data provide convincing evidence of a difference in mean redundant adjective usage percentages between sparse (4 item) and dense (16 item) displays for English speakers?” Note that the English speaking participants were each evaluated on both the 4 item and the 16 item displays. Therefore, the variable of interest is the difference in redundant percentage. The statistic of interest will be the average of the differences, here \(\bar{x}_{diff} =\) 43.18.

Data from the first six English speaking participants are seen in Table 23.4. Although the redundancy percentages seem higher in the 16 item task, a hypothesis test will tell us whether the differences observed in the data could be due to natural variability.

Table 23.4: Six participants who speak English with redundancy difference.
subject redundant_perc_4 redundant_perc_16 diff_redundant_perc
1 100 100 0
2 0 0 0
3 100 100 0
4 10 80 70
5 0 90 90
6 0 70 70

We can answer the research question using a hypothesis test with the following hypotheses:

\[H_0: \mu_{diff} = 0\] \[H_A: \mu_{diff} \ne 0\]

where \(\mu_{diff}\) is the true difference in redundancy percentages when comparing a 16 item display with a 4 item display. Recall that the computational method used to assess a hypothesis pertaining to the true average of a paired difference shuffles the observed percentage across the two groups (4 item vs 16 item) but within a single participant. The shuffling process allows for repeated calculations of potential sample differences under the condition that the null hypothesis is true.

Figure 23.5 shows the distribution of 1,000 mean differences from redundancy percentages permuted across the two conditions. Note that the distribution is centered at 0, since the structure of randomly assigning redundancy percentages to each item display will balance the data out such that the average of any differences will be zero.

Distribution of 1,000 mean differences of redundant adjective usage percentage among English speakers who were shown images with 4 and 16 items. Overlaid on the distribution is the observed average difference in the sample (solid line) as well as the difference in the other direction (dashed line), which is far out in the tail, yielding a p-value that is approximately 0.
Figure 23.5: Distribution of 1,000 mean differences of redundant adjective usage percentage among English speakers who were shown images with 4 and 16 items. Overlaid on the distribution is the observed average difference in the sample (solid line) as well as the difference in the other direction (dashed line), which is far out in the tail, yielding a p-value that is approximately 0.

With such a small p-value, we reject the null hypothesis and conclude that the data provide convincing evidence of a difference in mean redundant adjective usage percentages across different displays for English speakers.

23.3.4 Two independent means test

Finally, let’s consider the question “How does redundant adjective usage differ between English speakers and Spanish speakers?” The English speakers are independent from the Spanish speakers, but since the same subjects were shown the two types of displays, we can’t combine data from the two display types (4 objects and 16 objects) together while maintaining independence of observations. Therefore, to answer questions about language differences, we will need to conduct two hypothesis tests, one for sparse displays and the other for dense displays. In each of the tests, the hypotheses are as follows:

\[H_0: \mu_{English} = \mu_{Spanish}\] \[H_A: \mu_{English} \ne \mu_{Spanish}\]

Here, the randomization process is slightly different than the paired setting (because the English and Spanish speakers do not have a natural pairing across the two groups). To answer the research question using a computational method, we can use a randomization test where we permute the data across all participants under the assumption that the null hypothesis is true (no difference in mean redundant adjective usage percentages across English vs Spanish speakers).

Figure 23.6 shows the null distributions for each of the two hypothesis tests. The p-value for the 4 item display comparison is very small (0.002) while the p-value for the 16 item display is much larger (0.102).

Distributions of 1,000 differences in randomized means of redundant adjective usage percentage between English and Spanish speakers. Plot A shows the differences in 4 item displays and Plot B shows the differences in 16 item displays. In each plot, the observed differences in the sample (solid line) and the differences in the other direction (dashed line) are overlaid. In the 4 item display the observed value is not seen as a potential observation from the randomized mean distribution. In the 16 item display, the observed value is a possible value on the randomized mean distribution, but it still falls in the tail of the distribution.
(a) The differences in 4 item displays.
Distributions of 1,000 differences in randomized means of redundant adjective usage percentage between English and Spanish speakers. Plot A shows the differences in 4 item displays and Plot B shows the differences in 16 item displays. In each plot, the observed differences in the sample (solid line) and the differences in the other direction (dashed line) are overlaid. In the 4 item display the observed value is not seen as a potential observation from the randomized mean distribution. In the 16 item display, the observed value is a possible value on the randomized mean distribution, but it still falls in the tail of the distribution.
(b) The differences in 16 item displays.
Figure 23.6: Distributions of 1,000 differences in randomized means of redundant adjective usage percentage between English and Spanish speakers. In each plot, the observed differences in the sample (solid line) and the differences in the other direction (dashed line) are overlaid.

Based on the p-values (a measure of deviation from the null claim), we can conclude that the data provide convincing evidence of a difference in mean redundant adjective usage percentages between languages in 4 item displays (small p-value) but not in 16 item displays (not small p-value). The results suggests that language patterns around redundant adjective usage might be more similar for denser displays than sparser displays across English and Spanish speakers.

23.4 Interactive R tutorials

Navigate the concepts you’ve learned in this part in R using the following self-paced tutorials. All you need is your browser to get started!

You can also access the full list of tutorials supporting this book here.

23.5 R labs

Further apply the concepts you’ve learned in this part in R with computational labs that walk you through a data analysis case study.

You can also access the full list of labs supporting this book here.

中文

23  应用:推断

23.1 回顾:计算方法

我们介绍的计算方法适用于两种情形。第一,在许多实际应用中(如本书所涵盖的内容),数学模型和计算模型会给出相同的结论。当结论没有差异时,计算方法的优势在于它能让分析者很好地理解统计推断过程的逻辑。第二,当结论存在差异时(主要出现在超出本书范围的方法中),计算方法通常依赖的技术条件更少,因此使用起来更为合适。

23.1.1 随机化

随机化检验的一个重要特征是,数据的置换方式使得原假设为真。随机化分布提供了在原假设下所关注统计量的分布,而这正是计算 p 值所需的信息——p 值是在原假设为真时,获得观测数据或更极端数据的概率。虽然有针对原假设不为真之外情形调整随机化的方法,但本书不作介绍,这些方法也不常用。在使用随机化检验研究问题时,务必问自己原假设代表什么,以及置换数据是如何创建不同的可能原假设数据表示的。

假设检验。 使用随机化检验时,我们按以下步骤进行:

  • 写出适当的假设。

  • 计算所关注统计量的观测值。

  • 反复对数据进行置换,每次重新计算所关注的统计量。

  • 计算置换后的统计量与观测统计量同样极端或更极端的比例,这就是 p 值。

  • 根据 p 值得出结论,并结合具体情境用通俗易懂的语言写出结论,使任何人都能理解结果。

23.1.2 自助法(Bootstrapping)

与随机化检验不同,自助法是对原始总体的一种代理抽样。使用自助法时,分析者并不强制原假设为真(或为假),而是在复制从总体中重复抽样时所见到的变异性。由于不存在潜在的真(或假)原假设,自助法通常用于为所关注的参数创建置信区间。自助法也可用于检验参数的特定值(例如,通过评估某个特定关注值是否包含在置信区间内),但一般来说,自助法用于区间估计而非假设检验。

置信区间。 以下是我们通常使用自助法计算置信区间的方法:

  • 以与原始数据相同的样本量,对原始数据进行有放回的重复抽样。

  • 对每次重抽样,计算所关注的统计量。

  • 使用以下方法之一计算置信区间:

    • 自助百分位区间:获取代表自助统计量中间部分(例如 95%)的端点。这些端点即为置信区间。

    • 自助标准误(SE)区间:求自助统计量的标准误。置信区间由原始观测统计量加上或减去若干倍(例如 2 倍)的标准误得到。

  • 用通俗语言并结合具体情境阐述结论,使即使不是统计学家和数据科学家的人也能理解结果。

23.2 回顾:数学模型

用于产生推断性分析的数学模型针对不同的目标参数遵循一个一致的框架。作为对比和比较数学方法的一种方式,我们在 表 23.1表 23.2.

23.2.1 z-程序

一般来说,当响应变量为分类变量(或二元变量)时,汇总统计量是比例,用于描述该比例的模型是标准正态曲线(也称为 \(z\)-曲线或 \(z\)-分布)。我们提供 表 23.1 ,一方面是为了帮助理解 \(z\)程序,另一方面是为了强调 \(z\)分布在实践中极为常见的使用。

表 23.1:z-方法在二元响应变量的单样本和两个独立样本分析中的相似性。 \(p\) 表示总体比例, \(\hat{p}\) 表示样本比例, \(p_0\) 表示原假设比例, \(\hat{p}_{pool}\) 表示合并比例, \(n\) 表示样本量。下标 1 和 2 表示这些值分别是针对样本 1 和样本 2 测量的。
单样本 两个独立样本
响应变量 二分类 二分类
关注的参数 比例: \(p\) 比例之差: \(p_1 - p_2\)
关注的统计量 比例: \(\widehat{p}\) 比例之差: \(\widehat{p}_1 - \widehat{p}_2\)
标准误:HT \(\sqrt{\frac{p_0(1-p_0)}{n}}\) \(\sqrt{\widehat{p}_{pool}\bigg(1-\widehat{p}_{pool}\bigg)\bigg(\frac{1}{n_1} + \frac{1}{n_2}}\bigg)\)
标准误:CI \(\sqrt{\frac{\widehat{p}(1-\widehat{p})}{n}}\) \(\sqrt{\frac{\widehat{p}_{1}(1-\widehat{p}_{1})}{n_1} + \frac{\widehat{p}_{2}(1-\widehat{p}_{2})}{n_2}}\)
条件 1. 独立性,2. 成功-失败 1. 独立性,2. 成功-失败

假设检验。 在应用 \(z\)-分布进行假设检验时,我们按以下步骤进行:

  • 写出适当的假设。

  • 验证使用 \(z\)分布。

    • 的适用条件。
    • 单样本:观测值(或差值)必须相互独立。应满足成功-失败条件,即至少有10次成功和至少10次失败。
  • 对于比例之差:每个样本必须分别满足成功-失败条件,且各组数据也必须相互独立。

  • 计算所关注的点估计值和标准误。

  • 根据 p 值得出结论,并结合具体情境用通俗的语言写出结论,使任何人都能理解该结果。

置信区间。 类似地,以下是我们通常如何使用 \(z\)-分布来计算:

  • 验证使用 \(z\)-分布的条件。(见上文。)
  • 验证使用 \(z^{\star}.\)
  • -分布的适用条件。(见上文。)
    计算所关注的点估计值、标准误以及 \(\pm\ z^{\star} SE.\)
  • 用通俗语言并结合具体情境阐述结论,使即使不是统计学家和数据科学家的人也能理解结果。

23.2.2 t 程序

对于定量响应变量,在三种不同的情境中, \(t\)分布被用作适当的数学模型。虽然这三种数据结构不同,但它们的异同值得指出。我们提供 表 23.2 ,一方面是为了帮助理解 \(t\)程序,另一方面是为了强调 \(t\)分布在实践中极为常见的使用。

表 23.2:在对数值响应变量进行单样本、配对样本和两个独立样本分析时, \(t\)方法的相似之处。 \(\mu\) 表示总体均值, \(\bar{x}\) 表示样本均值, \(s\) 表示标准差, \(n\) 表示样本量。 \(diff\) 的下标表示这些值是在配对差值上测量的。 \(1\)\(2\) 的下标表示这些值分别在样本 \(1\) 和样本 \(2\).
单样本 配对样本 两个独立样本
响应变量 数值型 数值型 数值型
关注的参数 均值: \(\mu\) 配对均值: \(\mu_{diff}\) 均值差异: \(\mu_1 - \mu_2\)
关注的统计量 均值: \(\bar{x}\) 配对均值: \(\bar{x}_{diff}\) 均值差异: \(\bar{x}_1 - \bar{x}_2\)
标准误差 \(\frac{s}{\sqrt{n}}\) \(\frac{s_{diff}}{\sqrt{n_{diff}}}\) \(\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}\)
自由度 \(n-1\) \(n_{diff} -1\) \(\min(n_1 -1, n_2 - 1)\)
条件 1. 独立性,2. 正态性或大样本 1. 独立性,2. 正态性或大样本 1. 独立性,2. 正态性或大样本

假设检验。 在应用 \(t\)-分布进行假设检验时,我们按以下步骤进行:

  • 写出适当的假设。

  • 验证使用 \(t\)分布。

    • 单样本或配对数据的差值:观测值(或差值)必须独立且近似正态。对于较大的样本量,我们可以放宽近似正态的要求,例如,样本量为15时轻微偏态是可以的,样本量为30时中等偏态可以,样本量为60时强偏态也可以。
    • 当数据不配对时求均值之差:每个样本均值必须分别满足 \(t\)-分布的单样本条件,且两组数据也必须相互独立。
  • 计算所关注的点估计、标准误和自由度。对于 \(df,\) 之间的面积,使用 \(n-1\) (单样本),对于两个样本,使用统计软件或取 \(n_1 - 1\)\(n_2 - 1.\)

  • 计算 T 分数和 p 值。

  • 根据 p 值得出结论,并结合具体情境用通俗的语言写出结论,使任何人都能理解该结果。

置信区间。 类似地,以下是我们通常如何使用 \(t\)-分布来计算:

  • 验证使用 \(t\)-分布的条件。(见上文。)
  • 计算感兴趣的点估计、标准误、自由度和 \(t^{\star}_{df}.\)
  • 使用一般公式计算置信区间: \[\mbox{point estimate } \pm\ t_{df}^{\star} SE.\]
  • 用通俗语言并结合具体情境阐述结论,使即使不是统计学家和数据科学家的人也能理解结果。

23.3 案例研究:冗余的形容词

看看 图 23.1中的图片。你会如何描述 图 23.1 (a)中圈出的项目?你会称它为“三角形”吗?还是“蓝色三角形”?那么在 图 23.1 (b)中呢?你的答案会改变吗?

Four shapes are presented twice. In the first set the shapes and colors are all different -- pink circle, yellow square, red diamond, blue triangle. In the second set the colors are all different but the triangle shape is repeated -- pink circle, yellow square, red triangle, blue triangle. In each set, the blue triangle is circled.
(a) 圈出的三角形是唯一的三角形。
Four shapes are presented twice. In the first set the shapes and colors are all different -- pink circle, yellow square, red diamond, blue triangle. In the second set the colors are all different but the triangle shape is repeated -- pink circle, yellow square, red triangle, blue triangle. In each set, the blue triangle is circled.
(b) 圈出的三角形是唯一的蓝色三角形。
图 23.1:两组各四个图形。

图 23.1 (a) 中,被圈出的项目是唯一的三角形,但在下图中,被圈出的项目是两个三角形之一。在 图 23.1 (a) 中,“那个三角形”足以描述被圈出的项目,但我们中的许多人可能仍会选择称其为“蓝色三角形”。在 图 23.1 (a) 中有两个三角形,因此“那个三角形”不再足够,要描述被圈出的项目,我们还必须用颜色加以限定,如“那个蓝色三角形”。

如果你用英语以外的语言回答上述问题,你的答案可能会有所不同。例如,在西班牙语中,形容词位于名词之后(例如,“el triángulo azul”),因此额外形容词的增量价值对于 图 23.1 (a).

可能有所不同。 (研究冗余形容词频繁使用(例如,将单个三角形称为“蓝色三角形”)及语言处理增量性的研究者设计了一个实验,向22名母语为英语的受试者(伦敦大学学院的本科生)和22名母语为西班牙语的受试者(巴利阿里群岛大学的本科生)展示了以下两幅图像。他们发现,在两种语言中,受试者在更密集、使用冗余颜色形容词更高效的显示中使用了更多冗余的颜色形容词。) Rubio-Fernandez et al. 2021 图 23.2.

Two presentations of shapes. In each presentation all of the shapes and their colors are unique. In the left presentation, the blue triangle is circled and is one of four shapes. In the right presentation, the blue triangle is circled and is one of sixteen shapes.
该研究中的一个显示示例如 Rubio-Fernandez 等人(2021).

Rubio-Fernandez et al. ( 中所述实验之一所使用的图像。在本案例研究中,我们将检验来自冗余形容词研究的数据,作者已将其发布在开放科学框架(Open Science Framework)上: osf.io/9hw68.

表 23.3 展示了数据的前六行。完整数据集共有88行。请记住,研究中共有44名受试者(22名英语使用者和22名西班牙语使用者)。数据集中每位受试者有两行数据:一行代表他们看到包含4个物品的图像时的数据,另一行代表看到包含16个物品的图像时的数据。每位受试者针对每种类型的图像被问了10个问题(每个问题中图像上物品的布局不同)。我们感兴趣的变量是 redundant_perc,它表示受试者在回答问题中使用冗余形容词来指代“the blue triangle”(蓝色三角形)的问题百分比。注意该变量是“百分比”,我们关注的是平均百分比。因此,我们将使用均值的方法。如果该变量是“成功或失败”(例如,“使用了冗余形容词或未使用”),我们就会使用比例的方法。

表 23.3:研究中收集数据的前六行。
language 受试者 items n_questions redundant_perc
英语 1 4 10 100
英语 1 16 10 100
英语 2 4 10 0
英语 2 16 10 0
英语 3 4 10 100
英语 3 16 10 100

23.3.1 探索性分析

在展示给受试者的图像中,一幅有4个物品,另一幅有16个物品。在每幅图像中,被圈出的物品是唯一的三角形,因此将其称为“the blue triangle”(蓝色三角形)或“el triángulo azul”被视为冗余。如果受试者的回答是“the triangle”(三角形),则记录为未使用冗余形容词。如果回答是“the blue triangle”(蓝色三角形),则记录为使用了冗余形容词。 图 23.3 展示了实验结果。我们可以看到,英语使用者比西班牙语使用者更倾向于使用冗余形容词,并且在两种语言中,当图像中的物品数量更多时(即在更密集的展示中),受试者更倾向于使用冗余形容词。

Results of redundant adjective usage experiment from @rubio-fernandez2021. English speakers are more likely than Spanish speakers to use redundant adjectives, regardless of number of items in image. For both images, respondents are more likely to use a redundant adjective when there are more items in the image.
图 23.3:来自 Rubio-Fernandez 等人(2021))的冗余形容词使用实验结果。无论图像中物品数量多少,英语使用者都比西班牙语使用者更倾向于使用冗余形容词。对于两张图像,当图像中的物品数量更多时,受访者更倾向于使用冗余形容词。

23.3.2 单一均值的置信区间

在这个实验中,当呈现包含 4 个物品的图像时,以英语作答的受试者中冗余形容词使用的平均百分比为 37.27。然而,除了作为点估计的样本平均值之外,我们还可以为英语使用者在描述不太密集的图像中的物品时使用冗余颜色形容词的真实平均冗余形容词使用率构建一个置信区间。

使用计算方法,我们可以通过自助法(bootstrapping)构建该区间。 图 23.4 展示了来自该样本的 1,000 个自助均值的分布。95% 置信区间(通过取自助分布的第 2.5 和第 97.5 百分位数计算得出)为 19.1% 到 56.4%。请注意,这个关于真实总体参数的区间只有在我们可以假设英语使用者样本能够代表所有英语使用者总体时才有效。

Distribution of 1,000 bootstrapped means of redundant adjective usage percentage among English speakers who were shown four items in images. Overlaid on the distribution is the 95% bootstrap percentile interval that ranges from 19.1% to 56.4%.
图 23.4:在图像中看到四个物品的英语使用者冗余形容词使用百分比的 1,000 个自助均值的分布。叠加在分布上的是范围从 19.1% 到 56.4% 的 95% 自助百分位数区间。

使用类似的技术,我们还可以为看到密集(16 个物品)展示的英语使用者,以及看到两种类型(4 个和 16 个物品)展示的西班牙使用者的真实平均冗余形容词使用百分比构建置信区间。然而,这些置信区间相互比较的意义不大,因为“真实平均冗余形容词使用百分比”的解释是一个相当抽象的概念。相反,我们可能对比较性问题更感兴趣,例如“在英语使用者和西班牙语使用者中,冗余形容词的使用在密集展示和稀疏展示之间是否存在差异?”或“冗余形容词的使用在英语使用者和西班牙语使用者之间是否存在差异?”要回答这些问题中的任何一个,我们需要进行假设检验。

23.3.3 配对均值检验

让我们从以下问题开始:“这些数据是否提供了令人信服的证据,表明英语使用者在稀疏(4 个物品)展示和密集(16 个物品)展示之间的平均冗余形容词使用百分比存在差异?”请注意,每位以英语为母语的参与者都在 4 个物品和 16 个物品的展示上接受了评估。因此,感兴趣的变量是冗余百分比的差异。感兴趣的统计量将是差异的平均值,此处为 \(\bar{x}_{diff} =\) 43.18.

前六位以英语为母语的参与者的数据见 表 23.4。尽管 16 个物品任务中的冗余百分比似乎更高,但假设检验将告诉我们数据中观察到的差异是否可能是由自然变异性造成的。

表 23.4:六位讲英语的参与者及其冗余差异。
受试者 redundant_perc_4 redundant_perc_16 diff_redundant_perc
1 100 100 0
2 0 0 0
3 100 100 0
4 10 80 70
5 0 90 90
6 0 70 70

我们可以使用带有以下假设的假设检验来回答研究问题:

\[H_0: \mu_{diff} = 0\] \[H_A: \mu_{diff} \ne 0\]

其中 \(\mu_{diff}\) 是比较 16 项显示与 4 项显示时冗余百分比的真实差异。回顾一下,用于评估关于配对差值真实平均值的假设的计算方法会将观察到的百分比在两组(4 项 vs 16 项)之间进行打乱,但 之内 单个参与者。打乱过程允许在原假设为真的条件下对潜在的样本差异进行重复计算。

图 23.5 展示了在两个条件之间置换冗余百分比后得到的 1,000 个平均差异的分布。请注意,该分布以 0 为中心,因为将冗余百分比随机分配给每个项目显示的结构会使数据达到平衡,从而使任何差异的平均值为零。

Distribution of 1,000 mean differences of redundant adjective usage percentage among English speakers who were shown images with 4 and 16 items. Overlaid on the distribution is the observed average difference in the sample (solid line) as well as the difference in the other direction (dashed line), which is far out in the tail, yielding a p-value that is approximately 0.
图 23.5:在观看 4 项和 16 项图像的英语使用者中,冗余形容词使用百分比的 1,000 个平均差异的分布。分布上叠加了样本中观察到的平均差异(实线)以及另一方向的差异(虚线),后者位于分布尾部很远处,得到的 p 值约为 0。

由于 p 值如此之小,我们拒绝原假设,并得出结论:数据提供了令人信服的证据,表明不同显示方式下英语使用者的平均冗余形容词使用百分比存在差异。

23.3.4 两个独立均值检验

最后,让我们考虑这样一个问题:“英语使用者和西班牙语使用者之间的冗余形容词使用有何不同?”英语使用者与西班牙语使用者是相互独立的,但由于相同的受试者观看了两种类型的显示,我们无法在保持观测独立性的前提下将两种显示类型(4 个物体和 16 个物体)的数据合并在一起。因此,要回答关于语言差异的问题,我们需要进行两次假设检验,一次针对稀疏显示,另一次针对密集显示。在每次检验中,假设如下:

\[H_0: \mu_{English} = \mu_{Spanish}\] \[H_A: \mu_{English} \ne \mu_{Spanish}\]

在这里,随机化过程与配对设置略有不同(因为英语使用者和西班牙语使用者在两组之间没有自然的配对关系)。为了使用计算方法回答研究问题,我们可以使用随机化检验,在原假设为真(英语使用者与西班牙语使用者之间的平均冗余形容词使用百分比没有差异)的假设下,对所有参与者的数据进行置换。

图 23.6 展示了两次假设检验各自的零分布。4 项显示比较的 p 值非常小(0.002),而 16 项显示的 p 值则大得多(0.102)。

Distributions of 1,000 differences in randomized means of redundant adjective usage percentage between English and Spanish speakers. Plot A shows the differences in 4 item displays and Plot B shows the differences in 16 item displays. In each plot, the observed differences in the sample (solid line) and the differences in the other direction (dashed line) are overlaid. In the 4 item display the observed value is not seen as a potential observation from the randomized mean distribution. In the 16 item display, the observed value is a possible value on the randomized mean distribution, but it still falls in the tail of the distribution.
(a) 4 项显示中的差异。
Distributions of 1,000 differences in randomized means of redundant adjective usage percentage between English and Spanish speakers. Plot A shows the differences in 4 item displays and Plot B shows the differences in 16 item displays. In each plot, the observed differences in the sample (solid line) and the differences in the other direction (dashed line) are overlaid. In the 4 item display the observed value is not seen as a potential observation from the randomized mean distribution. In the 16 item display, the observed value is a possible value on the randomized mean distribution, but it still falls in the tail of the distribution.
(b) 16 项显示中的差异。
图 23.6:英语使用者和西班牙语使用者之间冗余形容词使用百分比的 1,000 个随机化均值差异的分布。在每个图中,均叠加了样本中观察到的差异(实线)以及另一方向的差异(虚线)。

基于p值(一种衡量与原假设偏离程度的指标),我们可以得出结论:数据提供了令人信服的证据,表明在4个项目的展示中(p值较小),不同语言的冗余形容词使用百分比均值存在差异,但在16个项目的展示中则不存在(p值不够小)。结果表明,在英语和西班牙语使用者中,对于更密集的展示,围绕冗余形容词使用的语言模式可能比更稀疏的展示更为相似。

23.4 交互式 R 教程

使用以下自学教程在 R 中探索你在本部分所学的概念。你只需要一个浏览器即可开始!

您还可以访问支持本书的完整教程列表 这里.

23.5 R 实验课

通过引导您逐步完成数据分析案例研究的计算实验,在 R 中进一步应用您在本部分学到的概念。

您还可以访问支持本书的完整实验列表 这里.