Page 121/10/2018
M2R Economie internationale
17 janvier 2008
Solution de l’examen d’économétrie
Question 1
count
5284
count if gender_n==2
2655
Question 2
tab race
19 |
:population |
group | Freq. Percent Cum.
------+------
01-afric | 4,182 81.30 81.30
02-colou | 407 7.91 89.21
03-india | 119 2.31 91.52
04-white | 436 8.48 100.00
------+------
Total | 5,144 100.00
Question 3
sum incmon
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 636 1585.805 2106.602 0 16400
sum incmon if incmon<=10000
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 630 1473.13 1757.402 0 10000
Question 4
sort race
by race: sum incmon
------
-> race = 01-afric
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 338 824.2604 921.371 0 5960
------
-> race = 02-colou
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 77 1139.091 995.0228 0 6500
-> race = 03-india
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 20 2531.6 2011.258 280 7800
------
-> race = 04-white
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 89 4384.764 3145.977 200 16400
------
-> race = .
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 112 1798.089 2280.498 0 11500
. by race: sum incmon if incmon<=10000
------
-> race = 01-afric
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 338 824.2604 921.371 0 5960
------
-> race = 02-colou
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 77 1139.091 995.0228 0 6500
------
-> race = 03-india
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 20 2531.6 2011.258 280 7800
------
-> race = 04-white
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 84 3824.333 2134.668 200 10000
------
-> race = .
Variable | Obs Mean Std. Dev. Min Max
------+------
incmon | 111 1710.685 2093.929 0 9600
Question 5
sort hhid
. reg totmexp totminc if hhid~=hhid[_n-1]
Source | SS df MS Number of obs = 1024
------+------F( 1, 1022) = 395.98
Model | 879345471 1 879345471 Prob > F = 0.0000
Residual | 2.2696e+09 1022 2220705.91 R-squared = 0.2793
------+------Adj R-squared = 0.2785
Total | 3.1489e+09 1023 3078110.37 Root MSE = 1490.2
------
totmexp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
totminc | .2006579 .0100837 19.90 0.000 .1808707 .2204451
_cons | 1203.453 50.36378 23.90 0.000 1104.625 1302.282
predict mexphat if hhid~=hhid[_n-1]
graph twoway scatter totmexp totminc || line mexphat totminc if hhid~=hhid[_n-1]
Question 6
tab educ_new
Recoded |
Education | Freq. Percent Cum.
------+------
0 | 1,403 27.44 27.44
1 | 663 12.97 40.41
2 | 293 5.73 46.14
3 | 315 6.16 52.30
4 | 331 6.47 58.77
5 | 374 7.31 66.09
6 | 435 8.51 74.59
7 | 252 4.93 79.52
8 | 326 6.38 85.90
9 | 234 4.58 90.48
10 | 344 6.73 97.20
12 | 108 2.11 99.32
16 | 35 0.68 100.00
------+------
Total | 5,113 100.00
keep if age>=25 & age<=65
keep if (incmon>=0 & incmon~=.)
keep if educ_new~=.
. reg incmon educ_new
Source | SS df MS Number of obs = 421
------+------F( 1, 419) = 233.72
Model | 664868285 1 664868285 Prob > F = 0.0000
Residual | 1.1920e+09 419 2844755.4 R-squared = 0.3581
------+------Adj R-squared = 0.3565
Total | 1.8568e+09 420 4421001.9 Root MSE = 1686.6
------
incmon | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
educ_new | 301.3989 19.71498 15.29 0.000 262.6463 340.1515
_cons | -206.0145 145.6281 -1.41 0.158 -492.2672 80.2383
graph twoway scatter incmon educ_new || line inchat educ_new,
reg incmon educ_new age
Source | SS df MS Number of obs = 421
------+------F( 2, 418) = 119.87
Model | 676781025 2 338390513 Prob > F = 0.0000
Residual | 1.1800e+09 418 2823061.65 R-squared = 0.3645
------+------Adj R-squared = 0.3614
Total | 1.8568e+09 420 4421001.9 Root MSE = 1680.2
------
incmon | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
educ_new | 312.9772 20.43244 15.32 0.000 272.814 353.1403
age | 17.94223 8.734351 2.05 0.041 .7735001 35.11095
_cons | -963.2319 396.1364 -2.43 0.015 -1741.9 -184.5642
------
tab race, generate(raceid)
tab raceid2
-> tabulation of raceid2
race==02-co |
lou | Freq. Percent Cum.
------+------
0 | 367 87.17 87.17
1 | 54 12.83 100.00
------+------
Total | 421 100.00
tab raceid3
-> tabulation of raceid3
race==03-in |
dia | Freq. Percent Cum.
------+------
0 | 407 96.67 96.67
1 | 14 3.33 100.00
------+------
Total | 421 100.00
tab raceid4
-> tabulation of raceid4
race==04-wh |
ite | Freq. Percent Cum.
------+------
0 | 351 83.37 83.37
1 | 70 16.63 100.00
------+------
Total | 421 100.00
. reg incmon educ_new age raceid2 raceid3 raceid4
Source | SS df MS Number of obs = 421
------+------F( 5, 415) = 106.48
Model | 1.0434e+09 5 208687855 Prob > F = 0.0000
Residual | 813381524 415 1959955.48 R-squared = 0.5619
------+------Adj R-squared = 0.5567
Total | 1.8568e+09 420 4421001.9 Root MSE = 1400
------
incmon | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
educ_new | 185.2631 19.42997 9.53 0.000 147.0697 223.4565
age | 6.671661 7.334563 0.91 0.364 -7.745865 21.08919
raceid2 | 287.8807 208.6658 1.38 0.168 -122.2929 698.0543
raceid3 | 1722.132 389.4502 4.42 0.000 956.5913 2487.673
raceid4 | 2846.285 212.1007 13.42 0.000 2429.36 3263.211
_cons | -320.6505 334.1475 -0.96 0.338 -977.4831 336.1821
gen gender=gender_n
recode gender 3=0 2=1
(gender: 421 changes made)
tab gender
gender | Freq. Percent Cum.
------+------
0 | 242 57.48 57.48
1 | 179 42.52 100.00
------+------
Total | 421 100.00
. reg incmon educ_new age raceid2 raceid3 raceid4 gender
Source | SS df MS Number of obs = 421
------+------F( 6, 414) = 96.58
Model | 1.0831e+09 6 180509880 Prob > F = 0.0000
Residual | 773761517 414 1868989.17 R-squared = 0.5833
------+------Adj R-squared = 0.5772
Total | 1.8568e+09 420 4421001.9 Root MSE = 1367.1
------
incmon | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
educ_new | 183.1393 18.97933 9.65 0.000 145.8314 220.4471
age | 8.55595 7.174016 1.19 0.234 -5.546089 22.65799
raceid2 | 335.5943 204.0292 1.64 0.101 -65.46817 736.6567
raceid3 | 1604.053 381.1689 4.21 0.000 854.7854 2353.321
raceid4 | 2852.43 207.1245 13.77 0.000 2445.283 3259.577
gender | -624.9599 135.737 -4.60 0.000 -891.7796 -358.1402
_cons | -117.3054 329.2764 -0.36 0.722 -764.5675 529.9566
------
gen raceid2_gender=raceid2*gender
gen raceid3_gender=raceid3*gender
gen raceid4_gender=raceid4*gender
. reg incmon educ_new age raceid2 raceid3 raceid4 gender raceid2_gender raceid3_gender raceid4_gender
Source | SS df MS Number of obs = 421
------+------F( 9, 411) = 72.53
Model | 1.1394e+09 9 126601385 Prob > F = 0.0000
Residual | 717408332 411 1745519.06 R-squared = 0.6136
------+------Adj R-squared = 0.6052
Total | 1.8568e+09 420 4421001.9 Root MSE = 1321.2
------
incmon | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
educ_new | 172.8666 18.43997 9.37 0.000 136.6182 209.115
age | 6.018636 6.952892 0.87 0.387 -7.64903 19.6863
raceid2 | 367.5581 275.0768 1.34 0.182 -173.1749 908.2911
raceid3 | 1562.279 416.6274 3.75 0.000 743.2927 2381.266
raceid4 | 3729.071 255.3957 14.60 0.000 3227.026 4231.116
gender | -297.5276 159.5559 -1.86 0.063 -611.175 16.11987
raceid2_ge~r | -93.48782 393.663 -0.24 0.812 -867.3319 680.3563
raceid3_ge~r | 661.1474 875.1601 0.76 0.450 -1059.201 2381.496
raceid4_ge~r | -1982.464 359.7817 -5.51 0.000 -2689.706 -1275.222
_cons | -107.4139 318.8979 -0.34 0.736 -734.2883 519.4605
gen age2=age*age
reg incmon educ_new age raceid2 raceid3 raceid4 gender raceid2_gender raceid3_gender raceid4_gender age
> 2
Source | SS df MS Number of obs = 421
------+------F( 10, 410) = 65.15
Model | 1.1396e+09 10 113962929 Prob > F = 0.0000
Residual | 717191505 410 1749247.57 R-squared = 0.6138
------+------Adj R-squared = 0.6043
Total | 1.8568e+09 420 4421001.9 Root MSE = 1322.6
------
incmon | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------+------
educ_new | 173.3342 18.50736 9.37 0.000 136.953 209.7153
age | 25.57612 55.98419 0.46 0.648 -84.47575 135.628
raceid2 | 353.0549 278.4346 1.27 0.206 -194.2827 900.3924
raceid3 | 1548.171 418.9927 3.69 0.000 724.5293 2371.813
raceid4 | 3717.782 257.6712 14.43 0.000 3211.261 4224.304
gender | -302.0667 160.2457 -1.89 0.060 -617.0724 12.93902
raceid2_ge~r | -79.55956 396.064 -0.20 0.841 -858.1289 699.0098
raceid3_ge~r | 659.3466 876.1093 0.75 0.452 -1062.88 2381.573
raceid4_ge~r | -1962.115 364.774 -5.38 0.000 -2679.176 -1245.054
age2 | -.234394 .6657579 -0.35 0.725 -1.543119 1.074331
_cons | -489.2815 1130.637 -0.43 0.665 -2711.85 1733.288
------