|
|
@ -4,7 +4,14 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 假设检验:\n",
|
|
|
|
"## 假设检验的基本思想"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"### 假设检验\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<ul>\n",
|
|
|
|
" <li>什么是假设:对总体参数(均值,比例等)的具体数值所作的陈述。比如,我认为新的配方的药效要比原来的更好。\n",
|
|
|
|
" <li>什么是假设:对总体参数(均值,比例等)的具体数值所作的陈述。比如,我认为新的配方的药效要比原来的更好。\n",
|
|
|
|
" <li>什么是假设检验:先难总体的参数提出某种假设,然后利用样本的信息判断假设是否成立的过程。比如,上面的假设我是要接受还是拒绝呢\n",
|
|
|
|
" <li>什么是假设检验:先难总体的参数提出某种假设,然后利用样本的信息判断假设是否成立的过程。比如,上面的假设我是要接受还是拒绝呢\n",
|
|
|
@ -15,7 +22,7 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 假设校验的应用:\n",
|
|
|
|
"### 假设校验的应用\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<ul>\n",
|
|
|
|
" <li>推广新的教育方案后,教学效果是否有所\n",
|
|
|
|
" <li>推广新的教育方案后,教学效果是否有所\n",
|
|
|
|
" <li>提高醉驾判定为刑事犯罪后是否会使得交通事故减少\n",
|
|
|
|
" <li>提高醉驾判定为刑事犯罪后是否会使得交通事故减少\n",
|
|
|
@ -26,7 +33,7 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 假设校验的基本思想\n",
|
|
|
|
"### 假设校验的基本思想\n",
|
|
|
|
"<img src=\"assets/20201114091803.png\" width=\"70%\">"
|
|
|
|
"<img src=\"assets/20201114091803.png\" width=\"70%\">"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -41,7 +48,7 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 显著性水平\n",
|
|
|
|
"### 显著性水平\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<li>一个概率值,原假设为真时,拒绝原假设的概率,\n",
|
|
|
|
"<li>一个概率值,原假设为真时,拒绝原假设的概率,\n",
|
|
|
|
"表示为 alpha常用取值为0.01,0.05,0.10。\n",
|
|
|
|
"表示为 alpha常用取值为0.01,0.05,0.10。\n",
|
|
|
@ -56,7 +63,7 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 假设检验的步骤\n",
|
|
|
|
"### 假设检验的步骤\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<ul>\n",
|
|
|
|
" <li>提出假设\n",
|
|
|
|
" <li>提出假设\n",
|
|
|
|
" <li>确定适当的检验统计量。如方差验证、卡方验证等\n",
|
|
|
|
" <li>确定适当的检验统计量。如方差验证、卡方验证等\n",
|
|
|
@ -69,7 +76,14 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 原假设与备择建设\n",
|
|
|
|
"## 左右侧检验与双侧检验"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"### 原假设与备择建设\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<ul>\n",
|
|
|
|
" <li>待检验的假设又叫原假设,也可以叫零假设,表示为HO。(零假设其实就是表示原假设一般都是说没有差异,没有改变。。。)\n",
|
|
|
|
" <li>待检验的假设又叫原假设,也可以叫零假设,表示为HO。(零假设其实就是表示原假设一般都是说没有差异,没有改变。。。)\n",
|
|
|
|
" <li>与原假设对比的假设叫做备择假设,表示为H1\n",
|
|
|
|
" <li>与原假设对比的假设叫做备择假设,表示为H1\n",
|
|
|
@ -80,18 +94,100 @@
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"## 检验统计量计算检验的统计量\n",
|
|
|
|
"### 检验统计量计算检验的统计量\n",
|
|
|
|
"<ul>\n",
|
|
|
|
"<ul>\n",
|
|
|
|
" <li>计算检验的统计量\n",
|
|
|
|
" <li>计算检验的统计量\n",
|
|
|
|
" <li>根据给定的显著性水平,查表得出相应的临界值"
|
|
|
|
" <li>根据给定的显著性水平,查表得出相应的临界值\n",
|
|
|
|
|
|
|
|
" <li>将检验统计量的值与显著性水平的临界值进行比较\n",
|
|
|
|
|
|
|
|
" <li>得出拒绝或不拒绝原假设的结论"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"execution_count": null,
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"source": []
|
|
|
|
"### 检验中常说的小概率\n",
|
|
|
|
|
|
|
|
"<ul>\n",
|
|
|
|
|
|
|
|
"<li>在一次试验中,一个几乎不可能发生的事件发生的概率\n",
|
|
|
|
|
|
|
|
" <li>在一次试验中,小概率事件一旦发生,我们就有理由拒绝原假设\n",
|
|
|
|
|
|
|
|
" <li>小概率由我们事先确定,也就是多少的概率我们就拒绝原假设"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"### P值\n",
|
|
|
|
|
|
|
|
"<ul>\n",
|
|
|
|
|
|
|
|
" <li>是一个概率值\n",
|
|
|
|
|
|
|
|
" <li>如果原假设为真,P-值是抽样分布中大于或小于样本统计量的概率\n",
|
|
|
|
|
|
|
|
" <li>左侧检验时,P-值为曲线上方小于等于检验统计量部分的面积\n",
|
|
|
|
|
|
|
|
" <li>右侧检验时,P-值为曲线上方大于等于检验统计量部分的面积"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"### 左侧检验与右侧检验\n",
|
|
|
|
|
|
|
|
"<img src=\"assets/20201114095426.png\" width=\"100%\">"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"### 什么时候用左侧检验什么时候用右侧检验\n",
|
|
|
|
|
|
|
|
"<ul>\n",
|
|
|
|
|
|
|
|
"<li>当关键词有不得少于/低于的时候用左侧,比如灯泡的使用寿命不得少于/低于700小时\n",
|
|
|
|
|
|
|
|
"<li>当关键词有不得多于/高于的时候用右侧,比如次品率不得多于/高于5%"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"<img src=\"assets/20201114100216.png\" width=\"70%\">"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"<ul>\n",
|
|
|
|
|
|
|
|
" <li>单侧检验指按分布的一侧计算显著性水平概率的检验。用于检验大于、小于、高于、低于、优于、劣于等有确定性大小关系的假设检验问题。这类问题的确定是有一定的理论依据的。假设检验写作:μ1<μ2或μ1>μ2。\n",
|
|
|
|
|
|
|
|
" <li>双侧检验指按分布两端计算显著性水平概率的检验,应用于理论上不能确定两个总体一个一定比另一个大或小的假设检验。般假设检验写作H1: μ1≠μ2"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"一例如,某种零件的尺寸,要求其平均长度为10cm,大于或小于10cm均属于不合格我们想要证明(检验)大于或小于这两种可能性中的任何一种是否成立建立的原假设与备择假设应为:\n",
|
|
|
|
|
|
|
|
"<br>\n",
|
|
|
|
|
|
|
|
"H0:μ = 10; H1: μ≠10"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"### 检验结果\n",
|
|
|
|
|
|
|
|
"单侧检验\n",
|
|
|
|
|
|
|
|
"<ul>\n",
|
|
|
|
|
|
|
|
" <li>若p值 > α,不拒绝H0\n",
|
|
|
|
|
|
|
|
" <li>若p值 < α,拒绝H0"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"双侧检验\n",
|
|
|
|
|
|
|
|
"<ul>\n",
|
|
|
|
|
|
|
|
" <li>若p值 > α/2,bu'j'j\n",
|
|
|
|
|
|
|
|
" <li>"
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"metadata": {
|
|
|
|