Professional Documents
Culture Documents
TD Variation Finale EFFET FIXE
TD Variation Finale EFFET FIXE
Notes:
1. Unicode is supported; see help unicode_advice.
2. More than 2 billion observations are allowed; see help obs_advice.
3. Maximum number of variables is set to 5000; see help set_maxvar.
4. New update available; type -update all-
2 . browse
3 . reg Y X
1 10 25.00 25.00
2 10 25.00 50.00
3 10 25.00 75.00
4 10 25.00 100.00
Total 40 100.00
5 . reg Y X Z1 Z2 Z3 Z4 ,noconstant
6 . reg Y X Z2 Z3 Z4
7 . xi:reg Y X i.individus
i.individus _Iindividus_1-4 (naturally coded; _Iindividus_1 omitted)
9 . xtreg Y X,fe
F(1,35) = 309.87
corr(u_i, Xb) = 0.0205 Prob > F = 0.0000
td variation finale EFFET FIXE Thursday November 17 11:42:47 2022 Page 3
sigma_u 6.7034045
sigma_e 3.7472999
rho .76190642 (fraction of variance due to u_i)
F test that all u_i=0: F(3, 35) = 31.99 Prob > F = 0.0000
10 . egen m_y=mean(Y),by(individus)
11 . gen d_y=Y-m_y
12 . egen m_x=mean(X),by(individus)
13 . gen d_x=X-m_x
14 . areg Y X,absorb(i)
17 .
18 . set more off
19 .
20 . local SCR1=0
td variation finale EFFET FIXE Thursday November 17 11:42:47 2022 Page 4
21 .
22 . scalar N=4
23 .
24 . scalar T=10
25 .
26 . scalar K=1
27 .
28 . forvalues individus=1/4 {
2.
29 . qui reg Y X if i==`individus'
3.
30 . local SCR1=`SCR1'+e(rss)
4.
31 . }
32 .
33 . di `SCR1'
481.18038
34 .
35 .
36 .
37 . * Calcul de SCR1C contraint: Estimation sur le modèle empilé
38 .
39 . qui reg Y X
40 .
41 .
42 .
43 . local SCR1C=e(rss)
44 .
45 . di `SCR1C'
1838.9802
46 .
47 .
48 .
49 . *Calcul de la statistique de Fisher F1 N=33 T=15 K=5
50 .
51 . local F1=((`SCR1C'-`SCR1')*(N*T-N*(K+1)))/(`SCR1'*(N-1)*(K+1))
52 .
53 . *La P_value de F1
54 .
55 . di "dof1 = " (N-1)*(K+1) " dof2 = " (N*T-N*(K+1))
dof1 = 6 dof2 = 32
56 .
57 . local PVF1=Ftail((K+1)*(N-1),(N*T-N*(K+1)),`F1')
58 .
59 .
60 .
td variation finale EFFET FIXE Thursday November 17 11:42:47 2022 Page 5
62 .
63 . xtreg Y X,fe
F(1,35) = 309.87
corr(u_i, Xb) = 0.0205 Prob > F = 0.0000
sigma_u 6.7034045
sigma_e 3.7472999
rho .76190642 (fraction of variance due to u_i)
F test that all u_i=0: F(3, 35) = 31.99 Prob > F = 0.0000
64 .
65 .
66 .
67 . local SCR1CP=e(rss)
68 .
69 . di `SCR1CP'
491.47897
70 .
71 . *Calcul de la statistique de Fisher F2
72 .
73 . local F2=((`SCR1CP'-`SCR1')*(N*T-N*(K+1)))/(`SCR1'*(N-1)*K)
74 .
75 .
76 .
77 . *La P_value de F2
78 .
79 . di "dof1 = " K*(N-1) " dof2 = " (N*T-N*(K+1))
dof1 = 3 dof2 = 32
80 .
81 . local PVF2=Ftail(K*(N-1),(N*T-N*(K+1)),`F2')
82 .
83 .
84 .
85 . *Calcul de la statistique de Fisher F3
td variation finale EFFET FIXE Thursday November 17 11:42:47 2022 Page 6
86 .
87 . local F3=(`SCR1C'-`SCR1CP')*(N*(T-1)-K)/(`SCR1CP'*(N-1))
88 .
89 .
90 .
91 . *La P_value de F3
92 .
93 . di "dof1 = " (N-1) " dof2 = " (N*(T-1)-K)
dof1 = 3 dof2 = 35
94 .
95 . local PVF3=Ftail((N-1),(N*(T-1)-K),`F3')
96 .
97 .
98 .
99 . *Affichage des résultats
100 .
101 . di in y " SCR1 = " in gr `SCR1'
SCR1 = 481.18038
102 .
103 . di in y " SCR1C = " in gr `SCR1C'
SCR1C = 1838.9802
104 .
105 . di in y " SCR1CP = " in gr `SCR1CP'
SCR1CP = 491.47897
106 .
107 .
108 .
109 . di in y "F1 = " in gr `F1'
F1 = 15.049656
110 .
111 . di in y "F2 = " in gr `F2'
F2 = .22829612
112 .
113 . di in y "F3 = " in gr `F3'
F3 = 31.986817
114 .
115 .
116 .
117 . di in y "PvalF1 = " in gr `PVF1'
PvalF1 = 4.197e-08
118 .
119 . di in y "PvalF2 = " in gr `PVF2'
PvalF2 = .87600023
120 .
121 . di in y "PvalF3 = " in gr `PVF3'
PvalF3 = 3.900e-10
td variation finale EFFET FIXE Thursday November 17 11:42:47 2022 Page 7
123 .
124 . Estimationequation par equation
command Estimationequation is unrecognized
r(199);
125 .
126 . set more off
127 .
128 . local SCR1=0
129 .
130 . scalar N=4
131 .
132 . scalar T=10
133 .
134 . forvalues i=1/4 {
2.
135 . reg Y X if individus==`i'
3.
136 . local SCR1=`SCR1'+e(rss)
4.
137 . }
138 .
139 . display `SCR1'
481.18038
141 .