Skip to content

Commit 681c9ec

Browse files
Added file tab_5_3.ipynb
1 parent db58e14 commit 681c9ec

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

cap5/tab_5_3.ipynb

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"\n",
8+
"# <span style=\"color:rgb(213,80,0)\">Theoretical size</span>\n",
9+
"\n",
10+
"This file creates theoretical parts of Tables 5.2 and 5.3\n",
11+
"\n",
12+
"## Sample size"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": 1,
18+
"metadata": {},
19+
"source": [
20+
"n=[50 100 200 2000];"
21+
],
22+
"outputs": []
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"## THEORETICAL INDIVIDUAL SIZE"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": 2,
34+
"metadata": {},
35+
"source": [
36+
"p=2;\n",
37+
"\n",
38+
"pro2=1000*(1-betacdf( n*chi2inv(0.99,1)./(n-p).^2 ,0.5,(n-p-1)/2));\n",
39+
"disp(pro2)\n",
40+
"\n",
41+
"p=10;\n",
42+
"\n",
43+
"pro10=1000*(1-betacdf(n*chi2inv(0.99,1)./(n-p).^2,0.5,(n-p-1)/2));\n",
44+
"disp(pro10)\n",
45+
"\n",
46+
"varn=\"n=\"+n;\n",
47+
"rown=[\"p=2\" \"p=10\"];\n",
48+
"TAB52=array2table([pro2; pro10],\"RowNames\",rown,\"VariableNames\",varn);\n",
49+
"disp('Theoretical individual size')\n",
50+
"disp(TAB52)"
51+
],
52+
"outputs": []
53+
},
54+
{
55+
"cell_type": "markdown",
56+
"metadata": {},
57+
"source": [
58+
"## THEORETICAL SIMULTANEOUS SIZE"
59+
]
60+
},
61+
{
62+
"cell_type": "code",
63+
"execution_count": 3,
64+
"metadata": {},
65+
"source": [
66+
"p=2;\n",
67+
"pstar=(betacdf(n.*chi2inv(1-0.01./n,1)./((n-p).^2),0.5,(n-p-1)/2));\n",
68+
"pstar2=1000*(1-pstar.^n);\n",
69+
"% disp(pstar2)\n",
70+
"\n",
71+
"p=10;\n",
72+
"pstar=(betacdf(n.*chi2inv(1-0.01./n,1)./((n-p).^2),0.5,(n-p-1)/2));\n",
73+
"pstar10=1000*(1-pstar.^n);\n",
74+
"%disp(pstar10)\n",
75+
"\n",
76+
"TAB53=array2table([pro2; pro10],\"RowNames\",rown,\"VariableNames\",varn);\n",
77+
"disp('Theoretical simultaneous size')\n",
78+
"disp(TAB53)\n",
79+
"\n",
80+
"%InsideREADME"
81+
],
82+
"outputs": []
83+
}
84+
],
85+
"metadata": {
86+
"kernelspec": {
87+
"display_name": "MATLAB (matlabkernel)",
88+
"language": "matlab",
89+
"name": "matlab"
90+
},
91+
"language_info": {
92+
"file_extension": ".m",
93+
"mimetype": "text/matlab",
94+
"name": "matlab",
95+
"nbconvert_exporter": "matlab",
96+
"pygments_lexer": "matlab",
97+
"version": "25.1.0.2943329"
98+
}
99+
},
100+
"nbformat": 4,
101+
"nbformat_minor": 4
102+
}

0 commit comments

Comments
 (0)