Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

exam2019 Monday May 27 15:07:23 2019 Page 1

___ ____ ____ ____ ____(R)


/__ / ____/ / ____/
___/ / /___/ / /___/
Statistics/Data Analysis

User: exam 2018

___ ____ ____ ____ ____ (R)


/__ / ____/ / ____/
___/ / /___/ / /___/ 15.0 Copyright 1985-2017 StataCorp LLC
Statistics/Data Analysis StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC http://www.stata.com
979-696-4600 stata@stata.com
979-696-4601 (fax)

4000-user Stata network license expires 15 Jun 2019:


Serial number: 301509003607
Licensed to: Stata/IC 15

Notes:
1. Unicode is supported; see help unicode_advice.
2. New update available; type -update all-

1 . import excel "C:\Users\Hien\Desktop\New folder\Econometrics\ECO EXAM musselsdata.xls", sheet("mu

2 . histogram musselweight, frequency


(bin=5, start=5.22, width=2.44)

3 . graph export "C:\Users\Hien\Desktop\New folder\Econometrics\musselweight_histogram.pdf", as(pdf)


(file C:\Users\Hien\Desktop\New folder\Econometrics\musselweight_histogram.pdf written in PDF form

4 . histogram musselsize, frequency


(bin=5, start=5.67, width=2.35)

5 . graph export "C:\Users\Hien\Desktop\New folder\Econometrics\musselsize_histogram.pdf", as(pdf) r


(file C:\Users\Hien\Desktop\New folder\Econometrics\musselsize_histogram.pdf written in PDF format

6 . summarize musselweight musselsize scan2d scan3d

Variable Obs Mean Std. Dev. Min Max

musselweight 30 11.05333 3.09837 5.22 17.42


musselsize 30 11.273 2.963115 5.67 17.42
scan2d 30 .4128697 .1028951 .22895 .65361
scan3d 30 43.84827 11.69077 19.28109 64.53115

7 . correlate musselweight musselsize scan2d scan3d


(obs=30)

mussel~t mussel~e scan2d scan3d

musselweight 1.0000
musselsize 0.9989 1.0000
scan2d 0.9183 0.9198 1.0000
scan3d 0.9761 0.9766 0.8926 1.0000

8 . regress musselweight

Source SS df MS Number of obs = 30


F(0, 29) = 0.00
Model 0 0 . Prob > F = .
Residual 278.397067 29 9.59989885 R-squared = 0.0000
Adj R-squared = 0.0000
Total 278.397067 29 9.59989885 Root MSE = 3.0984
exam2019 Monday May 27 15:07:23 2019 Page 2

musselweight Coef. Std. Err. t P>|t| [95% Conf. Interval]

_cons 11.05333 .5656824 19.54 0.000 9.896383 12.21028

9 . regress musselweight scan2d

Source SS df MS Number of obs = 30


F(1, 28) = 150.57
Model 234.743653 1 234.743653 Prob > F = 0.0000
Residual 43.6534134 28 1.55905048 R-squared = 0.8432
Adj R-squared = 0.8376
Total 278.397067 29 9.59989885 Root MSE = 1.2486

musselweight Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d 27.65051 2.253389 12.27 0.000 23.03465 32.26637


_cons -.3627224 .9578784 -0.38 0.708 -2.324847 1.599402

10 . regress musselweight scan3d

Source SS df MS Number of obs = 30


F(1, 28) = 563.82
Model 265.225715 1 265.225715 Prob > F = 0.0000
Residual 13.1713522 28 .470405434 R-squared = 0.9527
Adj R-squared = 0.9510
Total 278.397067 29 9.59989885 Root MSE = .68586

musselweight Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan3d .2586817 .0108942 23.74 0.000 .236366 .2809974


_cons -.2894133 .4938303 -0.59 0.563 -1.300979 .7221522

11 . regress musselweight scan2d scan3d

Source SS df MS Number of obs = 30


F(2, 27) = 356.94
Model 268.251476 2 134.125738 Prob > F = 0.0000
Residual 10.1455902 27 .3757626 R-squared = 0.9636
Adj R-squared = 0.9609
Total 278.397067 29 9.59989885 Root MSE = .61299

musselweight Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d 6.963988 2.454129 2.84 0.009 1.928531 11.99944


scan3d .2039696 .0215998 9.44 0.000 .1596505 .2482887
_cons -.7656011 .4721903 -1.62 0.117 -1.734455 .2032533
exam2019 Monday May 27 15:07:23 2019 Page 3

12 . predict uhattd, residual

13 . generate uhattd2 = uhattd ^2

14 . generate scan2d2 = scan2d ^2

15 . generate scan3d2 = scan3d ^2

16 . generate scan2dscan3d = scan2d *scan3d

17 . regress uhattd2 scan2d scan3d

Source SS df MS Number of obs = 30


F(2, 27) = 0.77
Model .41270811 2 .206354055 Prob > F = 0.4746
Residual 7.27069562 27 .269285023 R-squared = 0.0537
Adj R-squared = -0.0164
Total 7.68340373 29 .264944956 Root MSE = .51893

uhattd2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d .0606191 2.077527 0.03 0.977 -4.202114 4.323353


scan3d .0097251 .0182851 0.53 0.599 -.0277929 .0472431
_cons -.1132715 .3997296 -0.28 0.779 -.9334489 .706906

18 . regress uhattd2 scan2d scan3d scan2d2 scan3d2

Source SS df MS Number of obs = 30


F(4, 25) = 0.39
Model .45374243 4 .113435607 Prob > F = 0.8122
Residual 7.2296613 25 .289186452 R-squared = 0.0591
Adj R-squared = -0.0915
Total 7.68340373 29 .264944956 Root MSE = .53776

uhattd2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d 2.91534 11.4427 0.25 0.801 -20.65135 26.48203


scan3d -.0257749 .0969417 -0.27 0.793 -.2254301 .1738803
scan2d2 -3.001634 11.76821 -0.26 0.801 -27.23871 21.23544
scan3d2 .0003784 .0010054 0.38 0.710 -.0016923 .0024491
_cons .0295223 1.504127 0.02 0.984 -3.068285 3.127329

19 . regress

Source SS df MS Number of obs = 30


F(4, 25) = 0.39
Model .45374243 4 .113435607 Prob > F = 0.8122
Residual 7.2296613 25 .289186452 R-squared = 0.0591
Adj R-squared = -0.0915
Total 7.68340373 29 .264944956 Root MSE = .53776

uhattd2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d 2.91534 11.4427 0.25 0.801 -20.65135 26.48203


scan3d -.0257749 .0969417 -0.27 0.793 -.2254301 .1738803
scan2d2 -3.001634 11.76821 -0.26 0.801 -27.23871 21.23544
scan3d2 .0003784 .0010054 0.38 0.710 -.0016923 .0024491
_cons .0295223 1.504127 0.02 0.984 -3.068285 3.127329
exam2019 Monday May 27 15:07:24 2019 Page 4

20 . regress uhattd2 scan2d scan3d scan2d2 scan3d2 scan2dscan3d

Source SS df MS Number of obs = 30


F(5, 24) = 1.03
Model 1.36255622 5 .272511244 Prob > F = 0.4200
Residual 6.32084751 24 .263368646 R-squared = 0.1773
Adj R-squared = 0.0059
Total 7.68340373 29 .264944956 Root MSE = .51319

uhattd2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d -4.6825 11.66083 -0.40 0.692 -28.74926 19.38426


scan3d .0224553 .0960875 0.23 0.817 -.1758595 .2207701
scan2d2 -58.84725 32.09231 -1.83 0.079 -125.0825 7.388018
scan3d2 -.0059432 .0035358 -1.68 0.106 -.0132406 .0013543
scan2dscan3d 1.231373 .6628788 1.86 0.076 -.1367418 2.599487
_cons .5618096 1.463736 0.38 0.704 -2.459194 3.582813

21 . regress musselsize

Source SS df MS Number of obs = 30


F(0, 29) = 0.00
Model 0 0 . Prob > F = .
Residual 254.62143 29 8.78004931 R-squared = 0.0000
Adj R-squared = 0.0000
Total 254.62143 29 8.78004931 Root MSE = 2.9631

musselsize Coef. Std. Err. t P>|t| [95% Conf. Interval]

_cons 11.273 .5409883 20.84 0.000 10.16655 12.37945

22 . regress musselsize scan2d

Source SS df MS Number of obs = 30


F(1, 28) = 153.90
Model 215.428212 1 215.428212 Prob > F = 0.0000
Residual 39.193218 28 1.39975778 R-squared = 0.8461
Adj R-squared = 0.8406
Total 254.62143 29 8.78004931 Root MSE = 1.1831

musselsize Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d 26.48851 2.135171 12.41 0.000 22.11481 30.86221


_cons .3366994 .9076256 0.37 0.713 -1.522487 2.195886

23 . regress musselsize scan3d

Source SS df MS Number of obs = 30


F(1, 28) = 576.93
Model 242.835956 1 242.835956 Prob > F = 0.0000
Residual 11.7854744 28 .4209098 R-squared = 0.9537
Adj R-squared = 0.9521
Total 254.62143 29 8.78004931 Root MSE = .64878

musselsize Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan3d .2475224 .0103051 24.02 0.000 .2264133 .2686314


_cons .4195724 .4671282 0.90 0.377 -.5372964 1.376441
exam2019 Monday May 27 15:07:25 2019 Page 5

24 . regress musselsize scan2d scan3d

Source SS df MS Number of obs = 30


F(2, 27) = 373.26
Model 245.733855 2 122.866928 Prob > F = 0.0000
Residual 8.88757488 27 .32916944 R-squared = 0.9651
Adj R-squared = 0.9625
Total 254.62143 29 8.78004931 Root MSE = .57373

musselsize Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d 6.815258 2.296944 2.97 0.006 2.102318 11.5282


scan3d .1939787 .0202163 9.60 0.000 .1524983 .2354592
_cons -.0464454 .4419468 -0.11 0.917 -.9532454 .8603545

25 . predict uhatti, residual

26 . generate uhatti2 = uhatti ^2

27 . regress uhatti2 scan2d scan3d

Source SS df MS Number of obs = 30


F(2, 27) = 0.88
Model .388180779 2 .19409039 Prob > F = 0.4262
Residual 5.95298154 27 .220480798 R-squared = 0.0612
Adj R-squared = -0.0083
Total 6.34116232 29 .21866077 Root MSE = .46955

uhatti2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d -.3543488 1.879862 -0.19 0.852 -4.211507 3.50281


scan3d .0125799 .0165454 0.76 0.454 -.0213685 .0465283
_cons -.1090544 .3616976 -0.30 0.765 -.8511966 .6330878

28 . regress uhatti2 scan2d scan3d scan2d2 scan3d2

Source SS df MS Number of obs = 30


F(4, 25) = 0.49
Model .456843794 4 .114210949 Prob > F = 0.7464
Residual 5.88431853 25 .235372741 R-squared = 0.0720
Adj R-squared = -0.0764
Total 6.34116232 29 .21866077 Root MSE = .48515

uhatti2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d .0867243 10.32328 0.01 0.993 -21.17447 21.34792


scan3d -.0199719 .0874581 -0.23 0.821 -.2000951 .1601514
scan2d2 -.4834133 10.61694 -0.05 0.964 -22.34941 21.38259
scan3d2 .0003747 .0009071 0.41 0.683 -.0014934 .0022429
_cons .453507 1.35698 0.33 0.741 -2.341246 3.24826
exam2019 Monday May 27 15:07:25 2019 Page 6

29 . regress uhatti2 scan2d scan3d scan2d2 scan3d2 scan2dscan3d

Source SS df MS Number of obs = 30


F(5, 24) = 0.87
Model .973794141 5 .194758828 Prob > F = 0.5151
Residual 5.36736818 24 .223640341 R-squared = 0.1536
Adj R-squared = -0.0228
Total 6.34116232 29 .21866077 Root MSE = .47291

uhatti2 Coef. Std. Err. t P>|t| [95% Conf. Interval]

scan2d -5.643572 10.74539 -0.53 0.604 -27.82097 16.53383


scan3d .0164034 .0885441 0.19 0.855 -.1663427 .1991495
scan2d2 -42.60222 29.57291 -1.44 0.163 -103.6377 18.43326
scan3d2 -.004393 .0032582 -1.35 0.190 -.0111176 .0023315
scan2dscan3d .9287023 .6108396 1.52 0.141 -.3320086 2.189413
_cons .8549584 1.348826 0.63 0.532 -1.928881 3.638798

30 . regress musselweight scan2d scan3d, level(99)

Source SS df MS Number of obs = 30


F(2, 27) = 356.94
Model 268.251476 2 134.125738 Prob > F = 0.0000
Residual 10.1455902 27 .3757626 R-squared = 0.9636
Adj R-squared = 0.9609
Total 278.397067 29 9.59989885 Root MSE = .61299

musselweight Coef. Std. Err. t P>|t| [99% Conf. Interval]

scan2d 6.963988 2.454129 2.84 0.009 .1643742 13.7636


scan3d .2039696 .0215998 9.44 0.000 .1441235 .2638157
_cons -.7656011 .4721903 -1.62 0.117 -2.073891 .5426884

31 . regress musselweight scan3d, level(99)

Source SS df MS Number of obs = 30


F(1, 28) = 563.82
Model 265.225715 1 265.225715 Prob > F = 0.0000
Residual 13.1713522 28 .470405434 R-squared = 0.9527
Adj R-squared = 0.9510
Total 278.397067 29 9.59989885 Root MSE = .68586

musselweight Coef. Std. Err. t P>|t| [99% Conf. Interval]

scan3d .2586817 .0108942 23.74 0.000 .2285783 .2887852


_cons -.2894133 .4938303 -0.59 0.563 -1.653996 1.075169

32 . regress musselsize scan2d scan3d, level(99)

Source SS df MS Number of obs = 30


F(2, 27) = 373.26
Model 245.733855 2 122.866928 Prob > F = 0.0000
Residual 8.88757488 27 .32916944 R-squared = 0.9651
Adj R-squared = 0.9625
Total 254.62143 29 8.78004931 Root MSE = .57373
exam2019 Monday May 27 15:07:26 2019 Page 7

musselsize Coef. Std. Err. t P>|t| [99% Conf. Interval]

scan2d 6.815258 2.296944 2.97 0.006 .4511545 13.17936


scan3d .1939787 .0202163 9.60 0.000 .1379657 .2499917
_cons -.0464454 .4419468 -0.11 0.917 -1.27094 1.178049

33 . regress musselsize scan3d, level(99)

Source SS df MS Number of obs = 30


F(1, 28) = 576.93
Model 242.835956 1 242.835956 Prob > F = 0.0000
Residual 11.7854744 28 .4209098 R-squared = 0.9537
Adj R-squared = 0.9521
Total 254.62143 29 8.78004931 Root MSE = .64878

musselsize Coef. Std. Err. t P>|t| [99% Conf. Interval]

scan3d .2475224 .0103051 24.02 0.000 .2190466 .2759981


_cons .4195724 .4671282 0.90 0.377 -.8712255 1.71037

34 .

You might also like