> For the complete documentation index, see [llms.txt](https://ruyuanzhang.gitbook.io/compmodcogpsy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ruyuanzhang.gitbook.io/compmodcogpsy/di-san-zhang-gailtui-duan-he-bei-ye-si-li-lun/3.4-tuo-zhan-yue-dupzhi.md).

# 3.4 拓展阅读：p值

{% hint style="danger" %}

### <mark style="color:red;">**思考题**</mark>

为了比较华东师大学生2023年和2022年的饭量差异，我们分别测量了一些学生各自在2023年与2022年的饭量平均值，并将此数据集记为 $$\text data$$.

$$H\_0$$: 2022年和2023年的饭量没有显著差异

$$H\_1$$: 2022年和2023年的饭量有显著差异<br>

然后你做了一个简单t检验

请问这个$$p$$值的意义?

1. $$H\_0$$为真的概率, 即$$p(H\_0=\text True)$$
2. $$H\_1$$为真的概率, 即$$p(H\_1=\text True)$$
3. 基于当前数据，$$H\_0$$为真的概率，即$$p(H\_0=\text True | \text data)$$
4. 基于当前数据，$$H\_1$$为真的概率，即$$p(H\_1=\text True |\text  data)$$
5. 如果$$H\_0$$为真，观察到$$\text data$$当前数据的概率，即$$p(\text data | H\_0=\text True)$$
6. 如果$$H\_1$$为真，观察到当前数据的概率，即$$p(\text data | H\_1=\text True)$$
7. 如果$$H\_0$$为真，观察到当前数据甚至更极端的数据的概率，即$$p(\text data或者更极端 | H\_0=\text True)$$
8. 如果$$H\_1$$为真，观察到data甚至更极端的数据的概率，即$$p(\text data或者更极端 | H\_1=\text True)$$
   {% endhint %}

在假设检验中，我们认为数据可能是在两种原因下产生的，一是$$H\_0$$，二是$$H\_1$$。在$$t$$检验中，我们假设$$H\_0$$为真，$$p$$值代表的含义是观察到当前数据以及更极端数据的可能性。因此，如果我们使用条件概率的方式来看待熟悉的假设检验，正确的表示为：$$p = p(\text data或者更极端 | H\_0=\text True)$$

{% hint style="danger" %}

### <mark style="color:red;">**进一步思考**</mark>

1. $$p(\text data或者更极端| H\_0=\text True) + p(\text data或者更极端| H\_1=\text True) = 1$$ 一定成立吗？
2. 有没有可能 $$p(\text data或者更极端 | H\_1=\text True) < p(\text data或者更极端 | H\_0=\text True)$$?
   {% endhint %}

***

**一方面，如果我们使用本章所学的**[**似然函数**](/compmodcogpsy/di-san-zhang-gailtui-duan-he-bei-ye-si-li-lun/3.2-gailtui-duan/3.2.1-si-ran-han-shu.md#si-ran-han-shu)**的角度看待这个问题，我们可以将此问题中出现的概率填入**[**洒水问题**](/compmodcogpsy/di-san-zhang-gailtui-duan-he-bei-ye-si-li-lun/3.2-gailtui-duan/3.2.1-si-ran-han-shu.md#tiao-jian-gailfen-bu)**相似的表格。**

首先，将data或者更极端记做 $$\hat {data}$$，比data更常见记做 $${data}$$，可以得到表格如下:

<figure><img src="/files/xpSZ1f4e1pbUSy5UMR26" alt=""><figcaption></figcaption></figure>

对于问题1，由似然函数的性质可知，$$p(\text data或者更极端| H\_0=\text True) + p(\text data或者更极端| H\_1=\text True) = p+q$$ 不一定等于 1

但对于问题2， $$p(\text data或者更极端 | H\_1=\text True) < p(\text data或者更极端 | H\_0=\text True)  \iff q\<p$$$$p+ q$$ 的取值似乎并没有限制。

**另一方面，我们可以使用直观作图的方法来探究这两个问题。**

首先，我们需要明确 $$\text data或者更极端$$ 的定义。由于我们使用的是双尾检验，那么如下图3.1所示， $$\text data或者更极端$$ 应该被定义为**data以及远离** $$H\_0$$ **分布中心**。

<figure><img src="/files/eNCcwDikbysT4y7WZqQE" alt=""><figcaption></figcaption></figure>

接着，我们对$$H\_0$$和$$H\_1$$代表的两个分布进行可视化 (注意：$$H\_0$$和$$H\_1$$代表的两个分布方差一致)

在图3.2中，条件概率被表示为曲线下面积，如蓝色部分面积表示了$$p(\text data或者更极端| H\_0=\text True)$$,红色部分面积表示了$$p(\text data或者更极端 | H\_1=\text True)$$，橙色部分面积则表示了$$p(\text data| H\_1=\text True)$$。我们知道红色部分和橙色部分面积之和一定等于1。那么明显的（例如图中的极端情况蓝色部分面积远远小于橙色部分，并且很幸运的是，对于问题一我们只需举出一个反例就可以完全推翻），蓝色部分面积并不恒等于橙色部分面积，因此蓝色部分与红色部分面积综合并不一定为1。

<figure><img src="/files/CBIvjapIyB9imKhig09L" alt=""><figcaption><p>图3.2</p></figcaption></figure>

对于问题2：

1. 当$$H\_1$$在$$H\_0$$的右边，如图3.2所示，红色部分面积一定覆盖蓝色部分面积，代表$$p(\text data或者更极端| H\_1=\text True) > p(\text data或者更极端| H\_0=\text True)$$。
2. 当$$H\_1$$在$$H\_0$$的左边，由图3.1可知，可以得出和3.2完全对称的结果，因此也有$$p(\text data或者更极端| H\_1=\text True) > p(\text data或者更极端| H\_0=\text True)$$。
3. 当$$H\_1$$与$$H\_0$$两个分布完全一致时，两个分布完全重合，此时理论上有$$p(\text data或者更极端| H\_1=\text True) = p(\text data或者更极端| H\_0=\text True)$$。但这种情况意味着 $$H\_1$$与 $$H\_0$$在当前数据空间中完全是同一件事（例如测量了学生各自在2023年与2022年的饭量平均值，然后进行假设检验，$$H\_0$$: 明天会下雨，$$H\_1$$: 明天不会下雨），这与假设检验的原理（也和我们实际给出的例子不同）不符合，因此实际上并不会出现这种情况。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ruyuanzhang.gitbook.io/compmodcogpsy/di-san-zhang-gailtui-duan-he-bei-ye-si-li-lun/3.4-tuo-zhan-yue-dupzhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
