回答編集履歴
2
追記
answer
CHANGED
@@ -10,4 +10,33 @@
|
|
10
10
|
F = 2
|
11
11
|
print(f.sf(F, dfn=m-1, dfd=n-1))
|
12
12
|
# 0.11825764574839932
|
13
|
-
```
|
13
|
+
```
|
14
|
+
## 追記
|
15
|
+
α=0.1以上の分布表がないので作ってみました。
|
16
|
+
```python3
|
17
|
+
from scipy.stats import f
|
18
|
+
import pandas as pd
|
19
|
+
import matplotlib.pyplot as plt
|
20
|
+
m_max = 10
|
21
|
+
n_max = 15
|
22
|
+
a = 0.1
|
23
|
+
|
24
|
+
def F(a, m, n):
|
25
|
+
return f.ppf(1-a, dfn=m-1, dfd=n-1)
|
26
|
+
df = pd.DataFrame({m-1:[round(F(a, m, n),3) for n in range(2,n_max+1)] for m in range(2,m_max+1)}, index=[*range(1,n_max)])
|
27
|
+
fig, ax = plt.subplots()
|
28
|
+
ax.axis('off')
|
29
|
+
ax.axis('tight')
|
30
|
+
ax.table(cellText=df.values,
|
31
|
+
colLabels=df.columns,
|
32
|
+
rowLabels=df.index,
|
33
|
+
loc='center',
|
34
|
+
bbox=[0,0,1,1])
|
35
|
+
plt.title(f"α = {round(a,2)}")
|
36
|
+
plt.savefig(f'table_α={round(a,2)}.png')
|
37
|
+
```
|
38
|
+
下の表はα=0.05, 0.1, 0.2のF分布表です。(0.05はお持ちの本と同じ内容だと思います)
|
39
|
+
右下の自由度9&14のFの値が、2以上で2に一番近くなるのがα=0.1というのがわかると思います。
|
40
|
+

|
41
|
+

|
42
|
+

|
1
コード修正
answer
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
|
6
6
|
```python3
|
7
7
|
from scipy.stats import f
|
8
|
+
m = 10
|
8
9
|
n = 15
|
9
|
-
m = 10
|
10
10
|
F = 2
|
11
|
-
print(f.sf(F, dfn=
|
11
|
+
print(f.sf(F, dfn=m-1, dfd=n-1))
|
12
|
-
# 0.
|
12
|
+
# 0.11825764574839932
|
13
13
|
```
|