eviews 3.1 user’s guide - Головна сторінка - volfy's...

638

Upload: vuquynh

Post on 15-Apr-2018

242 views

Category:

Documents


3 download

TRANSCRIPT

  • EViews 3.1 Users Guide3rd Edition

    Copyright 19941999 Quantitative Micro Software, LLC

    All Rights Reserved

    Printed in the United States of America

    !

    "#$%&

    Disclaimer

    '

    Trademarks

    (($)($*(+ ,

    -,""

    ,,

    Quantitative Micro Software, LLC

    4521 Campus Drive, PMB 336, Irvine CA, 92612-2699

    Telephone: (949) 856-3368

    Fax: (949) 856-2044

    e-mail: [email protected]

    web:

    http://www.eviews.com

  • Table of Contents

    PREFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    PART I. EVIEWS FUNDAMENTALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    CHAPTER 1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

    (.'/ )

    .0' )

    (1&

    ' #2

    (345 #2

    CHAPTER 2. A DEMONSTRATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    (,.6 #)

    '6 #*

    678

    077

    579

    : 7&

    4:7%

    ".2#

    CHAPTER 3. EVIEWS BASICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    (,1 22

    ;

  • iiEViews 3.1 Users Guide

    ! *#

    (, **

    (,"> $7

    (,3 $&

    ". $%

    (, $*

    CHAPTER 6. EVIEWS DATABASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    "; #8#

    61#87

    (,;

  • Table of Contentsiii

    #$9

    3-#$9

    #$)

    CHAPTER 9. STATISTICAL GRAPHS USING SERIES AND GROUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

    63

    #$%

    64 78)

    7#2

    CHAPTER 10. GRAPHS, TABLES, AND TEXT OBJECTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

    3

    7#)

    3

    ;

  • ivEViews 3.1 Users Guide

    7%2

    7%9

    "07%%

    "0." 7*#

    "0."7*2

    6 7$7

    -6@-6A7$7

    + 7$%

    !07$*

    282

    CHAPTER 14. FORECASTING FROM AN EQUATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

    4:' 28)

    . 28*

    41 2#7

    46' 2#*

    4"0"278

    4:4272

    4+-627%

    27*

    CHAPTER 15. SPECIFICATION AND DIAGNOSTIC TESTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

    1,27$

    27$

    0 22%

    29#

    "

    2)8

    2))

    PART IV. ADVANCED SINGLE EQUATION ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357

    CHAPTER 16. ARCH AND GARCH ESTIMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359

    "05 2)$

    "05'2

    (,"05 2&)

    ""05 2&*

    "052%2

    .'2%9

  • Table of Contentsv

    2%&

    2%$

    6 2%$

    CHAPTER 17. DISCRETE AND LIMITED DEPENDENT VARIABLE MODELS . . . . . . . . . . . . . . . . . . . . . . 381

    16'2*#

    1'2*2

    -1:2$2

    ;6'2$$

    ;' 988

    ';: 982

    -;: 989

    0 98)

    '98&

    -:9#8

    09#)

    -: 9#&

    9#*

    ' 977

    - 972

    6 972

    97%

    +97%

    CHAPTER 18. THE LOG LIKELIHOOD (LOGL) OBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431

    ; 92#

    922

    92$

    ' 998

    - 99#

    992

    999

    99)

    PART V. MULTIPLE EQUATION ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453

    CHAPTER 19. SYSTEM ESTIMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455

    1,9))

  • viEViews 3.1 Users Guide

    9)&

    5 9)*

    (,(9&2

    9&*

    6 9&*

    CHAPTER 20. VECTOR AUTOREGRESSION AND ERROR CORRECTION MODELS . . . . . . . . . . . . . . . . . 477

    '" 9%%

    '"0'9%*

    '"0;9%$

    (,'"09*8

    ' 9*%

    9**

    '' 9$)

    (,' 9$&

    4'"0'9$%

    . 9$%

    6 )87

    )89

    CHAPTER 21. STATE SPACE MODELS AND THE KALMAN FILTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505

    )8)

    )8&

    )#9

    (,( )#%

    )#$

    )7#

    6 )77

    CHAPTER 22. POOLED TIME SERIES, CROSS-SECTION DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525

    (,4-6 )7)

    -;

  • Table of Contentsvii

    CHAPTER 23. MODELS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551

    ))#

    ))#

    : ))7

    )))

    ))*

    (, )

    )&9

    APPENDIX A. MATHEMATICAL OPERATORS AND FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565

    ; )&)

    6;4)&)

    14 )&&

    4)&%

    6)&*

    "4)&$

    4 )%7

    64 )%7

    :0 )%&

    :0 )%%

    APPENDIX B. GLOBAL OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579

    3; )%$

    APPENDIX C. DATE FORMATS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583

    6)*2

    .6 )*9

    64)*)

    )*)

    APPENDIX D. WILDCARDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587

    ( )*%

    !( )*%

    0" )**

    (-. )*$

    APPENDIX E. ESTIMATION ALGORITHMS AND OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591

    +;?" )$#

    ; )$9

  • viiiEViews 3.1 Users Guide

    +:)$%

    (6'!/)$*

    APPENDIX F. INFORMATION CRITERIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599

    6 )$$

    !.3 &88

    REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .601

    INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .607

  • Preface

    '

    4'

    B'

    =

    C -.D'4EB'.

    (

    '

    C -..D16"EB'>

    C -...D1:"EB=

    ::>:

    :

    C -.'D":"EB>

    ,@"05A

    ,

    C -'D:"EB

    :

    >F

    G>>

    '(-.

    ",

    #H2

    7

  • 2

  • Part I. EViews Fundamentals

    ,'

    C

    #H2(

    '

    7'

    C

    9),(

    ''

    '

    (

    C

    &'

    (-.

    ,'

    #H2

  • 4

  • Chapter 1. Introduction

    What Is EViews?

    '(>

    >(':,

    "

    '=

    '

    -

    '-#$*#'

    :>

    GG

    Installing and Running EViews

    1,>

    :=

    C "($)@A(+98@

    A

    C "#&@0"A(>

    270"

    C "'3"'3"

  • 6Chapter 1. Introduction

    C "(,

    C .?#8,

    ,',6,#>>

    ,,>>

    D'E

    .,

    C .(.+(

    C ;(

    ;

    C ..6,@6,#A

    @"=A

    C ,-,@(2#A,

    @($)A

    C "=!-+0@"=

    A

    ',(,

    6,#;

    '

    Windows Basics

    ((

    (

    :>

    (@A,(>

    The Mouse

    '(!

    ,>

    ,>

    (

    J,>

  • Windows Basics7

    Window Control

    ",?

    "

    (

    ,

    Changing the active window

    (,(

    @>A@

    FAG,,

    ,

    ,

    Scrolling

    (?

    @

    A

    5>

    ? ?

    5

    ?

    ,

    , >

    .,

    :,

    Minimize/Maximize/Restore/Close

    ',

    (;,'

  • 8Chapter 1. Introduction

    .

    >

    =

    1,@0F ?A

    ?!"#@1A

    @2A?

    .

    >

    G#,?

    >>

    ?,,>

    '

    Moving and Resizing

    G?@ ??A

    ,@

    >

    ?

    6?

    Selecting and Opening Items

    ,

    .,

    ,

    G=

    C :,

    "

  • Windows Basics9

    ",5.4,

    ,

    C >:,

    0,,

    C G0>,DE.

    :

    6,.

    ,

    Menus and Dialogs

    (

    >

    4 '=

    >(

    '

    (=

    C ">

    C "@A @>A

    C ">@8A@A

    C ",,@aA.

    ,,

    C ,G

    ,",>

    4 ">4'>

    C .,

    ",

    (6 >

    4

  • 10Chapter 1. Introduction

    '

    G

    >The EViews Window

    .'

    ',,=

    G?'(

    The Title Bar

    ('

    (

    @,A('.

    ','>

    ">"1

    '

    The Main Menu

    K.

    ,

    ,

    >

  • Windows Basics11

    4 ,;

    +>,.

    , .

  • 12Chapter 1. Introduction

    (>>

    ' (

    =,>

    ,

    !

    .'

    > >

    G?

    G?>

    0

    ?

    The Status Line

    "

    '

    ,

    ',

    ,.

    The Work Area

    ,'

    "1,

  • Closing EViews13

    ",

    G,

    G?,>

    Closing EViews

    'G "

    ">49",

    >

    ','

    >

    .'

    ,

    Where To Go For Help

    The EViews Manuals

    %&''

    '

    '

    .>

    ,

    %&'

    '.

    ',

    ,4

    ">,

    ('

    >

    ,

    The Help System

    "''

    '#

    '(5>

    ,G,,:>>

  • 14Chapter 1. Introduction

    .5

    The World Wide Web

    .

    (G

    :'

    "6>''>

    2#G'

    ",

    '

    "

    ,,J=$%

    http://www.eviews.com

  • Chapter 2. A Demonstration

    .

    '

    "

    2

    ,=

    C '

    C

    C

    C

    C

    Creating a Workfile and Importing Data

  • 16Chapter 2. A Demonstration

    4 ::#$)7#$$&

    G,::#$)7=#

    #$$&=9

    ;,(',>

    ,

    ,

    2 2)

    4,

    =

    ,

    ,

    +,>

    0.6"',

  • Creating a Workfile and Importing Data17

    6;L@'A,

    G,""

    '-

    ' =

    >

    @D9EA

    '''' ,('

    ,=

  • 18Chapter 2. A Demonstration

    ">> >

    '

    9D->

    E &9

    Verifying the Data

    (

  • Verifying the Data19

    .'

  • 20Chapter 2. A Demonstration

    Examining the Data

    (' 4

    /.$ ,

  • Examining the Data21

    (

    ,#1& $!

    log(m1),;M';3@#A

    + 0 #2

    ;3@#A=

    ( 0.$

    (0-!,;M=

  • 22Chapter 2. A Demonstration

    Estimating a Regression Model

    (##$)7=#H#$$7=9

    #$$2=#H7882=9

    @7#A

    @#A

    @36-A0

    @

    >

    A

    :

    =

    M1t( )log 1 2 GDPt 3RSt 4 PRt t+log+ +log+=

    PR( )log

  • Estimating a Regression Model23

    5>

    ( logdlog>

    #36--0

    >

    :,+,3

    #$)7=##$$&=9G#$)7=##$$7=9:

    ,(::=

    +:#$)7=7#$$7=9

    dlog

    t> 7 G

    44 .$:

    >

    =

    Dependent Variable: LOG(M1)Method: Least SquaresDate: 10/19/97 Time: 22:43Sample(adjusted): 1952:2 1992:4Included observations: 163 after adjusting endpoints

    Variable Coefficient Std. Error t-Statistic Prob.

    C 1.312383 0.032199 40.75850 0.0000LOG(GDP) 0.772035 0.006537 118.1092 0.0000

    RS -0.020686 0.002516 -8.221196 0.0000DLOG(PR) -2.572204 0.942556 -2.728967 0.0071

    R-squared 0.993274 Mean dependent var 5.692279Adjusted R-squared 0.993147 S.D. dependent var 0.670253S.E. of regression 0.055485 Akaike info criterion -2.921176Sum squared resid 0.489494 Schwarz criterion -2.845256Log likelihood 242.0759 F-statistic 7826.904Durbin-Watson stat 0.140967 Prob(F-statistic) 0.000000

    R2

  • 24Chapter 2. A Demonstration

    Specification and Hypothesis Tests

    (:

    4 :7

    (4 +

    :=

    +

    -0@9A@9A

    ''* 5''!

    c(4)=2'(=

  • Specification and Hypothesis Tests25

    @9AN7(

    :.

    >

    :

    6>(1>

    3 *

    ,/*!:

    #>=

    Wald Test:Equation: Untitled

    Null Hypothesis: C(4)=2

    F-statistic 23.53081 Probability 0.000003Chi-square 23.53081 Probability 0.000001

    Breusch-Godfrey Serial Correlation LM Test:

    F-statistic 813.0060 Probability 0.000000Obs*R-squared 136.4770 Probability 0.000000

    Test Equation:Dependent Variable: RESIDMethod: Least SquaresDate: 10/19/97 Time: 22:45

    Variable Coefficient Std. Error t-Statistic Prob.

    C -0.006355 0.013031 -0.487683 0.6265LOG(GDP) 0.000997 0.002645 0.376929 0.7067

    RS -0.000567 0.001018 -0.556748 0.5785DLOG(PR) 0.404143 0.381676 1.058864 0.2913RESID(-1) 0.920306 0.032276 28.51326 0.0000

    R-squared 0.837282 Mean dependent var 1.21E-15Adjusted R-squared 0.833163 S.D. dependent var 0.054969S.E. of regression 0.022452 Akaike info criterion -4.724644Sum squared resid 0.079649 Schwarz criterion -4.629744Log likelihood 390.0585 F-statistic 203.2515Durbin-Watson stat 1.770965 Prob(F-statistic) 0.000000

  • 26Chapter 2. A Demonstration

    D;O0>:E

    @A?>

    Modifying the Equation

    ,

    ;

    :,:

    =

    log(m1) c log(gdp) rs dlog(pr) log(m1(-1)) log(gdp(-1)) rs(-1)

    dlog(pr(-1))

    +

    ,(=

    +'

    (:,-

    :"3

    "@"0A

    F@"A:"0@#A

    ,:, -

    !':

    Dependent Variable: LOG(M1)Method: Least SquaresDate: 10/19/97 Time: 22:48Sample(adjusted): 1952:3 1992:4Included observations: 162 after adjusting endpoints

    Variable Coefficient Std. Error t-Statistic Prob.

    C 0.071297 0.028248 2.523949 0.0126LOG(GDP) 0.320338 0.118186 2.710453 0.0075

    RS -0.005222 0.001469 -3.554801 0.0005DLOG(PR) 0.038615 0.341619 0.113036 0.9101

    LOG(M1(-1)) 0.926640 0.020319 45.60375 0.0000LOG(GDP(-1)) -0.257364 0.123264 -2.087910 0.0385

    RS(-1) 0.002604 0.001574 1.654429 0.1001DLOG(PR(-1)) -0.071650 0.347403 -0.206246 0.8369

    R-squared 0.999604 Mean dependent var 5.697490Adjusted R-squared 0.999586 S.D. dependent var 0.669011S.E. of regression 0.013611 Akaike info criterion -5.707729Sum squared resid 0.028531 Schwarz criterion -5.555255Log likelihood 470.3261 F-statistic 55543.30Durbin-Watson stat 2.393764 Prob(F-statistic) 0.000000

  • Forecasting from an Estimated Equation27

    :-

    log(m1) c log(gdp) rs dlog(pr) ar(1)

    "0@#A,

    ('>

    =

    "0@#A>

    ",,?

    (,>

    Forecasting from an Estimated Equation

    (:

    >#$$2=#H#$$&=9

    ,"3:=

    Dependent Variable: LOG(M1)Method: Least SquaresDate: 10/19/97 Time: 22:52Sample(adjusted): 1952:3 1992:4Included observations: 162 after adjusting endpointsConvergence achieved after 14 iterations

    Variable Coefficient Std. Error t-Statistic Prob.

    C 1.050340 0.328390 3.198453 0.0017LOG(GDP) 0.794929 0.049342 16.11057 0.0000

    RS -0.007395 0.001457 -5.075131 0.0000DLOG(PR) -0.008019 0.348689 -0.022998 0.9817

    AR(1) 0.968100 0.018190 53.22283 0.0000

    R-squared 0.999526 Mean dependent var 5.697490Adjusted R-squared 0.999514 S.D. dependent var 0.669011S.E. of regression 0.014751 Akaike info criterion -5.564584Sum squared resid 0.034164 Schwarz criterion -5.469288Log likelihood 455.7313 F-statistic 82748.93Durbin-Watson stat 2.164265 Prob(F-statistic) 0.000000

    Inverted AR Roots .97

  • 28Chapter 2. A Demonstration

    (#$$2=#H#$$&=9>

    ,

    #P4#P

    +#:

    0-

    #$$2=#(,(

    '

    :

    =

  • Forecasting from an Estimated Equation29

    (@#A@

    >

    A$)Q4

    1& $!=

    @

    A$)Q>

    >

    (,('

    1

    1& !,

    =

    .$ ,=

  • 30Chapter 2. A Demonstration

    @#A

    $)Q#$$&=#

    4 .$ #2$+,6+7>

    =

    >@#A>

    :

    ( #,

    "3:#'

    #',('

  • Additional Issues31

    #

    =

    Additional Issues

    .

    4:"3"

    :@ * ,/

    *!#A

  • 32Chapter 2. A Demonstration

    >

    6,;3@#A

    .1&

    $!log(m1),;M

    "6,>4@"64A

    8*!,;M'

    "64=

    "64

  • Chapter 3. EViews Basics

    ,, >

    4'I,

    ?,

  • 34Chapter 3. EViews Basics

    )2,2&&

    !>

    J

    :,>

    ,>

    ,

    Creating a Workfile

    G',;,

    , &'!

    :

    ,

    @#%%&7878$%*$)8729AG78>

    79>@$%#$$%A+7>>

    78'"6#88

    1-=: =

    #$$7=#&)=97887=2

    /$-= =

    #$)&=##$$8=##

    &--=

    !

    0+3-!

    4 8:10:97,"

    #8#$$%.;*

    #$$%

    (,,

  • Workfile Basics35

    ,. ,>

    "#8"#$$%,

    (;*;#9#$$%

    ":,

  • 36Chapter 3. EViews Basics

    .,D&'E

    ,.,D!+.6E.

    ,,,

    K

    ,

    1'

    ,,@>

    A@

  • Workfile Basics37

    "

    '

    G ! !

    ,80'0-

    .,

  • 38Chapter 3. EViews Basics

    "'cd>

    DcdE@

    A

    Using MicroTSP Files

    G,-'

    *-%*-% 6;-

    , 0&'/&'

    G,-

    B,>

    Resizing Workfiles

    G,

    ,"

    ,

    ?, $2&'2!>

    ,.

    ,' ,.

    ,,'

    ,

    Sorting Workfiles

    1,

  • Workfile Basics39

    0-!,4,

    =

    .@,A

    =D*E@

    AD?E@A1

    , '

  • 40Chapter 3. EViews Basics

    '

  • Object Basics41

    :

    ,:

    ,

  • 42Chapter 3. EViews Basics

    -

    A '"0@'"A

    'F0'

  • Object Basics43

    Creating, Selecting, and Opening Objects

    Creating Objects

  • 44Chapter 3. EViews Basics

    Selecting Objects

  • Object Basics45

    ,

    "

    >

    )D(,">E $7

    The Object Window

    (

  • 46Chapter 3. EViews Basics

  • Object Basics47

    ,

  • 48Chapter 3. EViews Basics

    '

  • Object Basics49

    6E #78

    Copying Objects

  • 50Chapter 3. EViews Basics

  • Object Basics51

    Fetching Objects

    G,;>

    ,,

    ,

  • 52Chapter 3. EViews Basics

    Commands

    ,workfile,4

    workfile test1

    '(,0,#

    ,save,4

    save test2

    ,7

    '

  • Chapter 4. Basic Data Handling

    "'>

    ,'

    ,,

    ,'

    '=

  • 54Chapter 4. Basic Data Handling

    ,1& .! (

    Editing a series

    G

    C 4.

    ,$ $

    C + ,'

    G9 5

    =

    5 +

  • 55

    C (

    ,9 5

    Changing the Spreadsheet Display

    ',

    4,'

    :>

    :>

    G,>

    9 +@?

    ,A4 9 +

    =

    1,>

    19 5

    ,

  • 56Chapter 4. Basic Data Handling

    ,

    =

    C .'

    C .'

    ,

    ;:

    ,9 +9 +

    ',

    9 +

    Inserting and deleting observations in a series

    G,

    + ,)0G

    ,>

    =

    G>

    .

    '

    ,.

    ,.

    >

    ,

    Groups

    (,

  • 57

    G?

    4 >

    '"0'

    Creating Groups

    -

    !,,.

  • 58Chapter 4. Basic Data Handling

    ,(

    Editing in a Group

    ;,

    $.

    ,9 5

    0!0+

    ",9 5

    ,

    !,

    Samples

    ;'

    @A,

    FDE

    4 ',#$)2=#

    #$%8=#7#$$)=##$$&=#7;,#$)2=##$)*=#7

    0 2&

    The Workfile Sample

    (,

    ,,'>

    :!,

    ,

    G,,

    ,=

  • Samples59

    5#$)2=8##$)*=#7

    0 2&

    Changing the Sample

    =

    ,,>

    !

    ,

    ,

    .

    >

    >

    4

    D1950 1980 1990

    1995E'#$)8#$*8#$$8

    #$$):J#$*##$*$

    ',4

    ,@all,.,

    @all:#$)2=##$$&=#74

    @first@last,

    =

    @all

    @first 1996:12

    1953:1 @last

    >

    4

    ,

    1953:1 1953:1+11

    #7#$)2=#

  • 60Chapter 4. Basic Data Handling

    (' >

    >B'>

    G>

    .>@round

    @floor@ceil

    4 >

    =

    8% #$*8#$$2

    ,% U)888

    #$*8#$$2.+

    )888

    =

    8% 1958:1 1998:1

    ,% gdp > gdp(-1)

    :#$)*:#$$*36-

    :

    ;0"+6 4 >

    )888#2=

    8% V

    ,% U)888UN#2

    =

    8% )8#887887)8

    ,% UN9888U#7

    ,)8#887887)8

    .+;:98886!#7

    G'>=

    8% #$)*=##$$*=#

    ,% @UN&WN#2AWV@A

  • Samples61

    6

    "0++

    .

    4 .+

    .+U)888'

    Sample Objects

    ":,

    5:,>>

    :4'

  • 62Chapter 4. Basic Data Handling

    Using a Sample Object

    ;

    smpl,>

    ,,smpl=

    smpl 1955:1 1958:12 if rc>3.6

    +0@ ,.4

    AG,>

    .

  • Importing Data63

    Entering Data

    4,

    C G

    1& -.67

    =

    C 4,

    >

    , 5

    .+;@

    A-0!0+

    C 0:

    .

    0!0+'

    C ,

    -0!0+

    .,

    C (.

    ,.,

  • 64Chapter 4. Basic Data Handling

    Copying and Pasting

    (''

    . (

    (>>

    Copying from Windows applications

    >

    (

    ,

    '; =

    G'

    G.6.+0'

    ',

    .,1

    =

    ->

    Pasting into New Series

    '

    ,>

    @ #$)2=#

    #$$9=##A,

  • Importing Data65

    1& -.67+

    ,9 5

    5,#$)2=##$$$=#7

    '#$)2=8#

    ,,

    -

    >

    5G.6.+0

    ,

    '

    G

    +

    '(

    >>

    >>

    Pasting into Existing Series

    G '

    C

    ,$

    "

    ,:@A,

    C + ,.9 5

    -

    C 4,9 5

    C .,

    .>

  • 66Chapter 4. Basic Data Handling

    9 5 ,9 5

    Importing Data from a File

    G6

    "..@(M(M#(M2A @LA

    4,,

    + , ) *"+,+"G4

    ,

    >,"

    @

    AJ'>

    "..,

    '

    "..

    Spreadsheet Import

    ,'5

    )@ A=

    G 9@

    A

  • Importing Data67

    +=

    C 4;-+

    ;->

    "DE

    DE

    ; ?>

    . G.6.+0

    C + '>

    @

    >A

    .

    >17

    C

    ',

    @A

    "

    ",=

    C . '

    4 @L(M2(M#(MA

    ""..

    C . '>

    ".. >

    '

    "..

    ;,(

    =

    Spreadsheet Export

    G >

    "',

    F.

    ,

    .'

    B "#'

    ASCII Export

    ".. :

    =

  • 70Chapter 4. Basic Data Handling

    C G

    C '

    ,

    G'

    .>

    >

    Commands

    seriesgenr

    : =

    series logy = log(y)

    ;3GG

    group

    =

    group rhs c x1 x2 z

    05@AL#L7

    R

    show=

    show logy

    read

    @ A=

    read c:\data\cps88.dat

    export

    @ A =

    write a:\usmacro.dat

    '

    Addendum: Reading ASCII Files

    .'"..".. .

  • Addendum: Reading ASCII Files71

    G

    >

    >

    >

    "..

    +>

    #&MG

    G=

    C ''''.

    .

    '

    .*+-

    /^.'

    4 L@>2A'

    LPP2P8#.LPP2P8#'

    LPP2P87

    .'

  • 72Chapter 4. Basic Data Handling

    C 0G?.

    .

    C G

    ',

    ,

    '

    ,=

    # ';

    7 .'+" >

    2 ;

    .

    '"..

    '

    5

    G

    Delimiters

    6G>

    *>

    $7&

    4>

    4 DFE

    .>

    4 DFFE

    DFEDFFE

    '>

    4 DE*

    'DE.'

  • Addendum: Reading ASCII Files73

    Rectangular File Layout Options

    "..2

    >.'

    .>

    '

    M,"..',

    4>

    4

    >'

    '

    .',F

    4 2&'

    ,+,>

    J,

    Series Headers

    'DE

    4@A

    @A4

    ,=

    @A

    .7

    .

    #

    4>

    4

    ,=

  • 74Chapter 4. Basic Data Handling

    #89

    .

    #97',

    ,

    #8'

    08#H

    0894

    307#)$*88+"#*89*88+"'>

    >

    #'#9

    ,#

    #9#9

    Misc. Options1$2>?'

    :

    ::

    '

    :

    :

    02=@&'

    4 #8$8=9@

    "D=EA02,

    +"

    .,

    '=08#087.

    +*"' @

    A,

    6721'5

    1

    4 #888+"@

    ,

    A#8@

    A5#888

    #888

  • Addendum: Reading ASCII Files75

    -4

    X#8@+",

    AX

    .DXE-X#8>

    #8

    .>

    +4 K

    DGE DYEDyE

    *"'

    +"G

    DED>$$E

    G*"'

    Examples

    . ".. >

    ((( ,=

    >

    +1,+".%

    '

    1',*

    .,11

    '08#

    #2L

    ',

    08#+"#8+"#7

    '

    *2

    ,,=

  • 76Chapter 4. Basic Data Handling

    >>$$$8

    .6

    .'.6

    +",

    4 +"D"E

    DE

    G02,

    I+"4"..=

    +=

    C ,

    C 8

    C .,G

    C *"'

    4

    H$$$8H$$$

    ,=

  • Addendum: Reading ASCII Files77

    #8##

    #78

    =

    5,#8

    6"+"

    '@DFEA

    G

    =

  • 78Chapter 4. Basic Data Handling

    +=

    C ((

    C (,##,

    C (DFE

    :,,

    Addendum: Matrix Object Reading and Writing

  • Addendum: Matrix Object Reading and Writing79

    "06))4A,4(B7!

    .' +"

    @##A

    2'.2'

    .

    *' >

    "..."..

    @##A 4 2 2 L"..

    =

    1 2 3 4

    5 6 7 8

    9 10 11 12

    2 L>

    "..=

    1 2 3

    5 6 7

    9 10 11

    .' >>

    L=

    1 2 3

    4 5 6

    7 8 9

  • 80Chapter 4. Basic Data Handling

  • Chapter 5. Working with Data

    'I >

    (

    , '

    ,

    Using Expressions

    ;'>

    ' >

    (

    Operators

    '

    @+A@-A@*A@/A

    @^A

    5 + 6 * 7.0 / 3

    7 + 3e-2 / 10.2345 + 6 * 10^2 + 3e3

    3^2 - 9

    + >

  • 82Chapter 5. Working with Data

    . ,)&%8

    2@)Y#9N#$AJ ,2 7$@$H$N8A

    D-ED+E@A>

    .

    2-2

    -2+2

    2+++++++++++++-2

    2---2

    8

    ' >

    @A=

    C @-A@+A

    C @^A

    C @*A@/)

    C @+A@-A

    C @==)

    C and, or

    ">

    >

    (

    ,

    C -1^2@H#AZ7N#>

    C -1 + -2 * 3 + 4H#YH&Y9NH2

    C (-1 + -2) * (3 + 4)H2O%NH7#

  • Using Expressions83

    C 3*((2+3)*(7+4) + 3)2O@)O##Y2AN2O)*N#%9

    ""

    "D;4E

    )&)

    Series Expressions

    '

    4 >

    2*y + 3

    'G72(

    ,4

    x/y + z

    ,L>

    GR

    Series Functions

    ' >

    DE

    DE>

    ,

    @

    A

    '@>4 @mean

    ,@abs,

    "+"

    4

    4 @mean

    >

    ""

    "D;

    4E )&)

    Examples

    ( =

  • 84Chapter 5. Working with Data

    @trend(1980:1)

    @movav(x,4)

    @mean(x)*y + @var(x)*z

    1/@sqrt(2*@acos(-1))*exp(-1/2 * x^2)

    d(x,4)

    >

    Series Elements

    "'

    @elem

    @elem,=

    4

    #$*8=2:G>

    272L=

    @elem(y, 1980:3)

    @elem(x, 323)

    Logical Expressions

    " DEDE'

    ,DE

    >

    >

    (

    5000

    B.+ )888J

    W@A

    > @A = @:A=@:A

    @:A

  • Using Expressions85

    "DandEDorE5000 and educ>=13) or (incm>10000)

    .'#8

    >

    4 =

    0*(inc=100 and inc=200)

    8.+W#88#.+:#887887

    .+:788

    :@=A::

    (

    4

    incm = 2000

    7888

    Leads, Lags, and Differences

    .,

    income(-4)

    sales(2)

    ('

    >'

    J

    .>@round

    @floor@ceil

    .'4 >

    :

    income(-1 to -4)

  • 86Chapter 5. Working with Data

    .+;#9

    sales sales(-1) sales(-2) sales(-3) sales(-4)

    sales(0 to -4)

    sales(to -4)

    :"#9

    '>,

    D6ED6;3E4

    ,

    income - income(-1)

    log(income) - log(income(-1))

    :

    d(income)

    dlog(income)

    G,4 >

    d(income,4)

    dlog(income,4)

    >.+;@.+;A

    .,

    =

    d(income,1,4)

    dlog(income,1,4)

    9.>

    8=

    d(income,0,4)

    dlog(income,0,4)

    "

    "D;4E

    )&)

    Missing Data

    ;

    @>

    ?A'+"@A

  • Using Expressions87

    4+"'+"

    +">

    4 :'

    ,+"

    (

    +"'"@

    A"@A( >

    >

    :4 '

    4

    .,+"

  • 88Chapter 5. Working with Data

    x > 5

    DEDE>+"L+"L

    . +">

    4 L+">

    5*(x>3)

    +"5 >+"

    DE

    smpl 1 1000 if x>3

    smpl 1 1000 if x>3 and xNA

    :x>3+";:

    smpl 1 1000 if x

    4E )&)

    Working with Series

    ;

    ! >

  • Working with Series89

    G

    1>

    '>

    Basic Assignment

    G:

    4

    ' >:

    >

    4 G

    y = 2*x + 37*z

    G+">

    'G .G

    'G "

    ;> >

    =

    y = 3

    y = 37 * 2 + 3

    '

    Using Samples

    1

    .4 .

    !

    = y = z

    = @all if z-1

    .

    !

    = y = -2 + 3*z

    = @all if z>1

  • 90Chapter 5. Working with Data

    !

    = y = -.9 + .1*z

    = @all if z

    @A.

    Dynamic Assignment

    '

    :4

    ,#$9)#$$%

    =

    !

    = y = y + y(-1)

    = 1946 1997

    'GG(#$9&

    ,',

    GG

    G

    +

    ,

    Implicit Assignment

    G,>

    :'

    >:

    '4 =

    log(y) = x

    'Gy=exp(x)

    G=

  • Working with Series91

    1/y = z

    log(y/x)/14.14 = z

    log(@inv(y)*x) = z

    2+y+3*z = 4*w

    d(y) = nrnd

    .'#:>

    :=+H*/^log()exp()sqr()d()dlog()@inv()

    .:'>

    ?:G

    @tdist(y, 3) = x

    @tdist():','

    :

    :4 ':

    x + 1/x = 5

    .'D!?:E

    +

    :4

    log(x) = x

    '? >

    x = exp(x)

    L L'

    L:log(x) = x

    Command Window Assignment

    G4

    4

    seriesgenr,

  • 92Chapter 5. Working with Data

    series y = exp(x)

    genr y = exp(x)

    :G;:

    :,=

    smpl @all

    series y = exp(x)

    smpl 1950 1990 if y>300

    y = y/2

    Examples

    ,

    @ A=

    C @8#$*%=#A

    series time = @trend(1987:1)

    C - @##$*)=&A

    series index = price/@elem(price, 1985:6)

    C 6

    series high_inc = income>12000

    C 0

    series newser = x*(y>30) + z*(y

    ,>

    :> >

    >>

  • Working with Auto-series93

    "Creating Auto-series

    .>B

    ' 4

    -

    #$)2=8##$)*=#7;

    ;3-

    series logcp = log(cp)

    ;3- ,.$

    ">,$

    1& $!log(cp)'=

    +'

    >

    4>

    ;3@-A ,.$=

  • 94Chapter 5. Working with Data

    "

    +->>

    ,-

    #8=

    smpl 1953:01 1956:12

    cp = cp*10

    smpl 1953:01 1958:12

    >

    =

    >#7,>,

    -=

    show @exp(@movav(@log(cp),12))

    >=

  • Working with Auto-series95

    Using Auto-series in Groups

    ;,>

    4

    .

    cp @exp(@movav(@log(cp),12))

    =->>

    (

  • 96Chapter 5. Working with Data

    Using Auto-Series in Estimation

    ;> >>

    :log(x)exp(x+z) >

    '>>

    G >

    I;3G.

    log(y)

    (:>'

  • Accessing Individual Elements97

    C .,

    .

    C 0

    Accessing Individual Elements

    3,'

    D@nAE4 >

    "0;. "0;.@#A

    36-"0;.@7A.+'

    G,"0;.@#A'G

    ,$"0;.@#AG

    36-"

    macrolist(1) macrolist(2)

    gdp invest

    ( =

    series realgdp = macrolist(1)/price

    series y = 2*log(macrolist(3))

    =

    series macrolist(2) = macrolist(2)/price

    + series,:

    .+'

    ;

    D.@countE

    =

    scalar numgroup = macrolist.@count

    D@seriesnameE

  • 98Chapter 5. Working with Data

    Illustration

    ">

    ,">

    .> =

    log(y)

    G

    ",> :4

    =

    log(gdp)/price + d(invest) * (cons + invest)

    12345.6789 * 3.14159 / cons^2 + dlog(gdp)

    >

    G,,4

    =

    group g1 log(gdp)/price+d(invest)*(cons+invest)

    group g2 12345.6789*3.14159/cons^2+dlog(gdp)

    .

    G>3#@#A37@#AG

    >=

    group myseries g1(1) g2(1)

    G0.@#AG0.@7A.,>

    3#37,

    4

    "0.

    group altseries (log(gdp)/price) 3.141*cons/price

    "0.@#A"0.@7A

    Working with Scalars

  • Working with Scalars99

    show

    '

    '4

    scalar logl1=eq1.@logl

    show logl1

    ,:

  • 100Chapter 5. Working with Data

  • Chapter 6. EViews Databases

    "',

    '

    ,

    :

    '

    ",

    ,

    ',[-IF60.

    '

    An Overview

    "''

  • 102Chapter 6. EViews Databases

    Database Basics

    What is an EViews Database?

    "',

    61

    ,>

    1,

    ,,:

    Creating a Database

    0!

    '

    0$

    ,,(

    '

    .,

    @new\testA

    '

    @f:\public\testA

    '

    0*-JD

    06E #28,[-IF60.

    02->

    JD60E ##*

  • Database Basics103

    "=

    dbcreate db_name

    P

    The Database Window

    (

    :

    >>

    0!

    ;

    61,

    ,"

    4=

    dbopen db_name

    !,,

  • 104Chapter 6. EViews Databases

    ",,

  • Working with Objects in Databases105

    EViews .DB? files

    '2'->

    '-

    ;

    -0"5"R""?>

    +10@+10A61

    Working with Objects in Databases

    '

  • 106Chapter 6. EViews Databases

    1

    >

    4

    #$)8#$$8#$*8

    #$$)#$)8#$$) #$)8

    #$%$#$*8#$$)

    Fetching Objects from the Database

  • Working with Objects in Databases107

    >

  • 108Chapter 6. EViews Databases

    (,&'

    '%,

    ,,

  • Working with Objects in Databases109

  • 110Chapter 6. EViews Databases

    x* y*

    *c b*

    x*12? yz*f?abc

    a* b

    *x ?y

    x*y* *x*y*

    (

    ,=

  • Working with Objects in Databases111

    + ,

    copy x* db1::x*

    copy x* db1::

    .>

    ',

  • 112Chapter 6. EViews Databases

    D 2

    D

    D

    D ,

    D /"

    D /

    .2

    .+",>

    +".>

    +",

    @+"A

    4

    :,:,K#

    . K#+"+"

    :.+":

    K#2#

    .,

    ,:

    @A

    G

    @A'

    C ;:@ +

    !

    C ;@ 3-+

    0!A

    +"

    " :

    ,,

    ,.:,

    ,1

  • Working with Objects in Databases113

    :/"

    /,

    ,

    Low Frequency to High Frequency

    '

    ,:,

    :

    :>

    :::'I

    '

    =

    C =

    C 1=:

    C ,=

    C =

    C =6@ :A

    !>

    :

    :

    4:

    :

    C %$24%$B

    :>

    :.:

    :@A

    :

    :@A

    C 1%$241%$B:>

    :

    ::>

  • 114Chapter 6. EViews Databases

    ,

    "=

    #

    7 "

    2 :?@

    SIA

    @A

    Store, Fetch, and Copy of Group Objects

    "

  • Working with Objects in Databases115

    C

  • 116Chapter 6. EViews Databases

    C ,=

    C ,=

    C ,,=

    C ='

    )

    ' @LA

    '>

    =

    db_name::object_name

    .

  • Database Auto-Series117

    ,,:GL

    >

    @D60E ##*

    A!

    :,(series>

    series lgdp = log(gdp)

    ,,36-.'

    36-(

    '

    ls log(y) c log(x)

    GFL,+

    .>

    .

    ,G:

    ':

    >. >

    '

    @AJ, >

    .>

    ;

    4 =

    show db1::y db2::x

    , db1::y

    db2::x.@

    storecopyA4>

    ls log(db1::y) c log(db2::x)

    J

  • 118Chapter 6. EViews Databases

    The Database Registry

    ,

    .>

    '

    02-!60

    =

    2-'

    .,-

    =

    @A

    ,

    ",

    ;

    ='>

    '>4

    60.1".6""

    ,=

    ls c:\data\dribasic::gdp c c:\data\dribasic::gdp(-1)

  • The Database Registry119

    ,

    160.1".60.=

    ls dri::gdp c dri::gdp(-1)

    ?

    ,

    >

    4'

    ,)$, ,(

    60

    "

    ,

    60

    +$%, '

    ,.,>

    '

    .?>

    '>

    0'0$

    +>

    '2->

    @)$

    ,A

    C )'$=

    C )'$=

    C 0$=

  • 120Chapter 6. EViews Databases

    Querying the Database

    " :

    ,

  • Querying the Database121

    4:

    s**s*s*>

    !

  • 122Chapter 6. EViews Databases

  • Querying the Database123

    %

    ,:.

    +

    :;-

    "

    ,

    = monthly and start < 1950

    Name

    ==

    4

    name >= c and name < m

  • 124Chapter 6. EViews Databases

    matches

    : +matches

    :>

    ,4

    name matches "x* or y*" and freq = quarterly

    :

    name matches x* or y* and freq = quarterly

    matches

    Type

  • Querying the Database125

    freq

    :

    (,%

    mm/dd/yyyy

    mdy

    ;

    (

    :4

    start = mm/dd/yyyy

  • 126Chapter 6. EViews Databases

    "I,

    Description, Source, Units, Remarks, History, Display_name

  • Maintaining the Database127

    ::

    ,1-=

    % name, type, start, end, description

    $% description matches gasoline and freq>=q

    .=q

    :,=

    Maintaining the Database

    .: (

    '>

    ,

    Database File Operations

    1>

    ,:

    '

    -$$0$

    ,

    +.

    Packing the Database

    .

  • 128Chapter 6. EViews Databases

    ?

    ,??

    &8Q

    "?,

    ,,

    &$06?

    G,,

    -,"

    28Q

    "0

    DE>

    Dealing with Errors

    ,,

    -$0

    '

    6

    "

    "

    ',=*

    0)2-01,>

    ,

    *0)2-,

    .

    1>

    ,,

    G

    '

    0>

    ",,

    ,,>

  • Foreign Databases129

    ..'

    dbrebuild>

    @

    A=

    dbrebuild old_dbname new_dbname

    dbrebuild

    old_dbname,

  • 130Chapter 6. EViews Databases

    6160.61 (

    6;

    1-16.0'60.

    1,>

    Haver Analytics Databases

    .'2# 5"

    6

    5

    hconvert haver_db_path db_name

    5"'0P61P-"5561P+"

    G5'

    hfetch

    Connecting to Remote Databases

    '

    '.,>

    "

    [-IF60.@[-F60.A[-F60.

    '.

    ,..

    '-

    "

    [-F60.

    Enabling S&P / DRI Access

    "2#'[-F60.

    G

    .[-F60.[-F

    60.. [-F60.

  • Connecting to Remote Databases131

    [-F60.@,'>

    A[-F60.

    "[-F60.

    60.-.

    60.-,'G60.->

    '[-F60..>

    [-F60.,[-F60.

    Creating a Database Link

    "[-F60.'",>

    ,

    ,",

    64"!

    '

    ,

    .E 0)0&%

    [-F60.,,

    V4

    60.14

    Dbasic/fxE@>

    60.-,60.F[-,

    A',[-F60.,

    ,:

  • 132Chapter 6. EViews Databases

    ,%

    ,[-F60.

    [-F60.

    ",

    "

    ,

    ,

    (,;M"

    [-F60.,'G

    :>

    +[-F60.

    '

    [-F60.

    Understanding the Cache

    ",

  • Connecting to Remote Databases133

    0-''$2

    ,

    $>

    ,

    ,

  • 134Chapter 6. EViews Databases

    Dealing with Illegal Names

    [-F60.,

    '

    >

    '=

    )

  • Connecting to Remote Databases135

  • 136Chapter 6. EViews Databases

    Issues with S&P / DRI Frequencies

    [-F60.'"'

    :"[-F60.>

    :.[-F60.,

    :(,[-F

    60.[-F60. >

    :.[-F60.,

    :

    1

    ',

    [-F60.,,

    :,.

    :'

    :

    "

    :[-F60.,1'

    :'>

    ::'@D4>

    :EA

    .

    :[-F60..@

    : A

    .,[-F60. :>

    [-F60.:

    [-F60.:

    [-F60.:4

    =

    fetch x(Q) y(A)

    ::

    :.::

    G[-F60.

    [-F60.:

    Limitations of S&P / DRI Queries

    [-F60.,'

  • Connecting to Remote Databases137

    4:[-F60.'>

    =:P

    SI:[-F60.>

    ,@'

    ::

    [-F60.:A

    SI

    [-F60.[-F60.

  • 138Chapter 6. EViews Databases

    .[-F60.

    ,(,

    >

    G[-F60.@4 >

    .A

    '

    '

    +60.-'[-F60.

    '

    Commands

    !61

    dbcreate c:\evdata\usdb

    60.1".,

    dbopen dribasic

    >

    !#

    db us1

    +,!#

    ,,!#P1"M!#

    dbcopy us1 us1_bak

    !#

    dbdelete us1

  • Commands139

    store(1) gdp us1::x*

    1'

  • 140Chapter 6. EViews Databases

  • Part II. Basic Data Analysis

    %H#8'

  • 142

  • Chapter 7. Series

    '

    ;

    -

    *D3E

    ,show

    Series Views

    >,

    ,

    ,>

    J,

    ,

    Spreadsheet, Line Graph, and Bar Graph Views

    C $>

    C ,.$F

    #8:>

    ?

    C ;.$

    ,

  • 144Chapter 7. Series

    Descriptive Statistics

    Histogram and Stats

    :

    @ A>

    :

    ""

    /

    /@A

    /"/

    0@A>

    =

    @%#A

    N

    s yi y( )2

    i 1=

    N

    N 1( )=

    y

  • Series Views145

    &

    ,=

    @%7A

    @ A,

    ?-,

    ,

    (,M

    @%2A

    ,

    2., 2,@,A

    J,2@,A

    F3+;

    ,,

    =

    @%9A

    S,K,k>

    !K:>1

    7-K:>1

    @AB

  • 146Chapter 7. Series

    . .''-

    >

    G

    6

    :

    G

    J

    1' >

    +"$2

    ,-

    >

    (

    ,

    ,

    /2/2*/2'>

    4

    'F.

    '>

    "?1

    '?

    .;=

    G'',

    2>

    /"G' +

    ),

    #887.

    ,

    4 =

  • Series Views147

    ?"00.6!+.;+

    ,.

    J

    /2/2

    =

    Descriptive Statistics for LWAGECategorized by values of MARRIED and UNIONDate: 10/15/97 Time: 01:11Sample: 1 1000Included observations: 1000

    MeanMedianStd. Dev. UNIONObs. 0 1 All

    0 1.993829 2.387019 2.0529721.906575 2.409131 2.0149030.574636 0.395838 0.568689

    305 54 359

    MARRIED 1 2.368924 2.492371 2.4001232.327278 2.525729 2.3978950.557405 0.380441 0.520910

    479 162 641

    All 2.223001 2.466033 2.2754962.197225 2.500525 2.3025850.592757 0.386134 0.563464

    784 216 1000

    Descriptive Statistics for LWAGECategorized by values of MARRIED and UNIONDate: 10/15/97 Time: 01:08Sample: 1 1000Included observations: 1000

    UNION MARRIED Mean Median Std. Dev. Obs.0 0 1.993829 1.906575 0.574636 305

    1 2.368924 2.327278 0.557405 479All 2.223001 2.197225 0.592757 784

    1 0 2.387019 2.409131 0.395838 541 2.492371 2.525729 0.380441 162All 2.466033 2.500525 0.386134 216

    All 0 2.052972 2.014903 0.568689 3591 2.400123 2.397895 0.520910 641All 2.275496 2.302585 0.563464 1000

  • 148Chapter 7. Series

    Tests for Descriptive Stats

    Simple Hypothesis Tests

    J:

    . *'0 #-$*

    6

    Mean Test

    x:

    m>:m=

    @%)A

    .x't>>

    x=

    @%&A

    xNx!

    xt>t>

    .x'z>

    @%%A

    x!x

    z>

    /.z>,>

    H0: mH1: m

    =

    tx ms N---------------=

    x

    N 1

    zx m N----------------=

  • Series Views149

    G

    ' 1

    =

    p>>

    .?88)p>>

    Variance Test

    X:

    >: =

    @%*A

    'D >E=

    @%$A

    N x!>

    X > >

    p >

    'G

    Hypothesis Testing for LWAGEDate: 10/15/97 Time: 01:14Sample: 1 1000Included observations: 1000

    Test of Hypothesis: Mean = 2

    Sample Mean = 2.275496Sample Std. Dev. = 0.563464

    Method Value Probabilityt-statistic 15.46139 0.00000

    2

    2

    H0: var x( ) 2

    H1: var x( ) 2

    =

    2

    2 N 1( )s2

    2

    ------------------------=

    x

    2

    2

    N 1 min p 1 p,( )2

  • 150Chapter 7. Series

    Median Test

    x:m>:m=

    @%#8A

    ',>

    @#$*8A,@#$$%A

    ;2

    >+'>p>

    @A

    "2+&

    ,

    ( ,

    'p>

    >( T>@A

    67

    ( ,,>

    :@A'>

    p>@#$*8A

    /G

    H0: med x( ) mH1: med x( )

    =m

  • Series Views151

    Equality Tests by Classification

    :

    @A4

    4D5E #9*4

    :D:E #)#

    *'0 3-*-'!>

    4

    +"

    D>

    E #9&

    Mean Equality Test

    >>

    @A

    @A

    Hypothesis Testing for LWAGEDate: 10/14/97 Time: 23:23Sample: 1 1000Included observations: 1000

    Test of Hypothesis: Median = 2.25

    Sample Median = 2.302585

    Method Value ProbabilitySign (exact binomial) 532 0.046291Sign (normal approximation) 1.992235 0.046345Wilcoxon signed rank 1.134568 0.256556van der Waerden (normal scores) 1.345613 0.178427

    Median Test Summary

    Category Count Mean Rank

    Obs > 2.25 532 489.877820Obs < 2.25 468 512.574786Obs = 2.25 0

    Total 1000

  • 152Chapter 7. Series

    6i>g :

    @%##A

    @%#7A

    g F>:

    @%#2A

    NF>F>

    :

    4@ A't>

    :F>=

    xg i, i 1 ng, ,= g 1 G, ,=

    SSB ng xg x( )2

    g 1=

    G

    =

    SSB xig xg( )2

    i 1=

    ng

    g 1=

    G

    =

    xg x

    FSSB G 1( )SSW N G( )------------------------------------=

    G 1N G

    G 2=

  • Series Views153

    :

    :

    :N:F

    F>

    FN1:F(:

    Median Equality Tests

    ',>G>

    /+$-U( (

    >,

    ,

    ( ,

    Test for Equality of Means of LWAGECategorized by values of MARRIED and UNIONDate: 10/14/97 Time: 12:28Sample: 1 1000Included observations: 1000

    Method df Value Probability

    Anova F-statistic (3, 996) 43.40185 0.0000

    Analysis of Variance

    Source of Variation df Sum of Sq. Mean Sq.

    Between 3 36.66990 12.22330Within 996 280.5043 0.281631

    Total 999 317.1742 0.317492

    Category Statistics

    Std. Err.UNION MARRIED Count Mean Std. Dev. of Mean

    0 0 305 1.993829 0.574636 0.0329040 1 479 2.368924 0.557405 0.0254681 0 54 2.387019 0.395838 0.0538671 1 162 2.492371 0.380441 0.029890

    All 1000 2.275496 0.563464 0.017818

    G 2=( )

  • 154Chapter 7. Series

    '>

    ( >@A,

    @,#A,

    #,7.

    '

    U>@Ap>>4,@#$$%A

    (&++--&?>(

    >

    ,' >:

    M,>(>

    @A!

    >

    @,#$$%A

    67M,>(

    ,:@

    #$*8A'

    $+3,>"+;'"

    ,@#$*8AA

    !>:

    'GI

    G@,#$$%7#*A

    .p>'

    4 /

    (@,A>

    Variance Equality Tests

    G:

    $@#$*#A>

    F@ ALSF>

    @%#9A

    gF>F>

    :

    2

    2

    G 1

    2

    G 1

    2

    G 1

    G 2=

    F sL2sS2=

    sg2

    nL 1nS 1

  • Series Views155

    2+*&-@ A

    :>

    >(U:@ #)2A,4>,

    ,",#

    ,7,2",9

    ,).

    ,>,

    ,'

    >,

    @,#$$%

    #$&H78%AA

    ;

    !

  • 156Chapter 7. Series

    Quantile-Quantile

    :>:@A>

    ::>

    Kernel Density

    ,>

    >

    ,

    D EDE@#$*&A

    ',

    One-Way Tabulation

    ( +-*!

    ;G+"

    D>

    E #9)

    >@n>A

    *

    Correlogram

    ?

    ,( 2!>

  • Series Views157

    G@Axd(x)=x

    x(1)

    d(x)-d(x(-1)) = x-2x(-1)+x(-2)

    GJ

    =

    Autocorrelations (AC)

    yk=

    @%#)A

    yk

    . ?.

    k

    yt y( ) yt k y( )t k 1+=

    T

    yt y( )2

    t 1=

    T

    -------------------------------------------------------------=

    y

    1 k

  • 158Chapter 7. Series

    k>

    @"0A. ?

    >>@"A

    #2D>

    E 7%2"0"

    +'

    =

    @%#&A

    '

    (>

    '?

    .

    ?@

    A)Q

    Partial Autocorrelations (PAC)

    k

    y>k

    .>

    k

    k?

    -"p"0@pAp-"

    @"A?

    'k

    @%#%A

    k

    @%#*A

    k

    k

    yt y( ) yt k y( )( ) T K( )t k 1+=

    T

    yt y( )2T

    t 1=

    T

    -----------------------------------------------------------------------------------------=

    yt k yt k T k( )=y yt yt k

    2 T

    yt k ytyt 1 yt k, ,

    k

    1 for k 1=

    k k 1 j, k jj 1=

    k 1

    1 k 1 j, k jj 1=

    k 1

    ------------------------------------------------ for k 1>

    =

    k

    k j, k 1 j, kk 1 k j,=

  • Series Views159

    1 K,@#$%&-'6A>

    @%#$A

    .

    ?@

    A)Q>

    Q-Statistics

    1 Q>p>>Q>k>

    k=

    @%78A

    j>T.

    "0."Q

    :.

    "0."

    +,

    1

    "0"L@6?,#$$8>

    A

    Q>

    .

    >5

    4

    @#$$8#$$2A

    Unit Root Test

    6,>4->-

    F

    #2

    '@ 7$%A

    yt 0 1yt 1 k 1 yt k 1( ) kyt k et+ + + + +=

    et2 T

    QLB T T 2+( )j2

    T J-------------

    j 1=

    k

    =

    j

    2

  • 160Chapter 7. Series

    Conversion Options

    ('>

    :,

    :

    'J"

    1G,

    , !

    Label

    ,=

    G

    ,8>

    F>

    -

    78+

    @78A

    ,J.0-

  • Series Procedures161

    Generate by Equation

    >

    )

    Seasonal Adjustment

    ::

    :4

    ,6

    4>>>>

    4L##

  • 162Chapter 7. Series

    >>@

    A

    Census X-11 Methods

    L>##@A

    !1##

    '

    L##7LL##L

    ' L##6;#LL##6;2L

    L>##6;'.L>##>

    'L>##"##6;"

    L>##L##6; '

    G

    ##,:::

    :q :q

    9 (

    =

    yt

    yt

    xt0.5yt 6+ yt 0.5yt 6+ + +( ) 12 for monthly series

    0.5yt 2+ yt 1+ yt yt 1 0.5yt 1++ + +( ) 4 for quarterly series

    =

    t yt xt=

    imt

    iq t

  • Series Procedures163

    @%77A

    ) s

    y

    j

  • 164Chapter 7. Series

    G=

    $2/$G

    $2G

    '

    e@A

    '?>

    :6T>

    B

    ,

    >

    "

    8#J

    '

    $G'>

    ,

    G

    @A,

    '

    -'G#7

    9:

    ,

    Single Smoothing (one parameter)

    @%72A

    @A

    1

    @%79A

    yt yt

    yt yt 1 ( )yt 1+=

    0 1< yt

    yt 1 ( )syt ss 0=

    t 1

    =

  • Series Procedures165

    B

    @%7)A

    T

    '

    1;I@#$%$A

    8#28,:G' ?

    :>

    Double smoothing (one parameter)

    @A

    6y>

    @%7&A

    SD+

    4

    @%7%A

    >

    Holt-Wintersmultiplicative (three parameters)

    >

    @%7*A

    ytyt

    yT k+ yT for all k 0>=

    yt

    yt

    St yt 1 ( )St 1+=Dt St 1 ( )Dt 1+=

    0 1(B

    @ A?

    Illustration

    " >

    @5A#$*)=8#H#$**=#760.1#$)$=8#H

    #$*9=#7,5(4#,5

    , "$2!(5>(B>

    5P

    #$)$#H#$*9#7

    (,('>

    @A:

    :?

    yt

    yt k+ a bk+=

    a b,

    a t( ) yt 1 ( ) a t 1( ) b t 1( )+( )+=b t( ) a t( ) a t 1( )( ) 1 b t 1( )+=

    0 1

  • 168Chapter 7. Series

    >

    4

    ,

    ,J

    (

    =

    Date: 10/15/97 Time: 00:57Sample: 1959:01 1984:12Included observations: 312Method: Holt-Winters Multiplicative SeasonalOriginal Series: HSForecast Series: HS_SM

    Parameters: Alpha 0.7100Beta 0.0000Gamma 0.0000

    Sum of Squared Residuals 40365.69Root Mean Squared Error 11.37441

    ( ) ( )

    End of Period Levels: Mean 134.6584Trend 0.064556Seasonals: 1984:01 0.680745

    1984:02 0.7115591984:03 0.9929581984:04 1.1585011984:05 1.2102791984:06 1.1870101984:07 1.1275461984:08 1.1217921984:09 1.0501311984:10 1.0992881984:11 0.9183541984:12 0.741837

    ( )

  • Series Procedures169

    >,

    @#$*8I#$$%A5,-?

    !

    5,>-@5-A>

    sy?ys

    s5- ?=

    @%2*A

    "

    5,>- #&+!

    5,>-4

    =

    60

    80

    100

    120

    140

    160

    180

    200

    85:01 85:07 86:01 86:07 87:01 87:07 88:01 88:07

    Actual Housing Starts

    Holt-WintersMultiplicative

    st

    yt st( )2

    t 1=

    T

    st 1+ st( ) st st 1( )( )2t 2=

    T 1

    +

    st

    st st

  • 170Chapter 7. Series

    4'

    +

    '=

    @%2$A

    '>

    (,('

    +,6

    +"

    Commands

    >

    4

    ("3

    lwage.hist

    50:2

    hrs.teststat(mean=3)

    :.+K!0:

    injure.qqplot(u)

    36-78

    gdp.correl(20)

    100 for annual data

    1,600 for quarterly data

    14,400 for monthly data

    =

  • Commands171

    36-5,>-#&88

    36-P5-

    gdp.hpf(1600) gdp_hp

  • 172Chapter 7. Series

  • Chapter 8. Groups

    ,=

    C ,,>

    C ,>

    C ,?

    C ,

  • 174Chapter 8. Groups

    -*

    Dated Data Table

    >

    G:>

    :

    4

    :36-

    =

    ,

    "

    :=

    ":

    +

    >:,

    Creating and Specifying a Dated Data Table

    00*

    @A

    1988 1988CS 3128.2 3147.8 3170.6 3202.9 3162.4GDP 4655.3 4704.8 4734.5 4779.7 4718.6

    1989 1989CS 3203.6 3212.2 3235.3 3242.0 3223.3GDP 4817.6 4839.0 4839.0 4856.7 4838.1

    1987 1988 1989 89:1 89:2 89:3 89:4

    CS 3052.2 3162.4 3223.3 3203.6 3212.2 3235.3 3242.0GDP 4540.0 4718.6 4838.1 4817.6 4839.0 4839.0 4856.7

  • Dated Data Table175

    G0

    ;+

    *@;A*

    ;

    '

    Table Setup

    (,*;

    =

    C n

    n>

    C .>

    :,

    4:'>

    ,

    :>

    :

    .:

    . =

    C +:@:,A

    C "

    C

    C

    .':@:A:

  • 176Chapter 8. Groups

    4

    ,:

    #$$%=#H7882=9

    +

    @A>

    ::

    :@:A

    @:A=

    ':

    @(?

    .>

    >A

    .

    :

    =

    +,*9

    '3-'3-

    ',:

    =

    1997 1998 1997 1998GDPR 1775.4 1784.9 1789.8 1799.6 1810.6 1820.9

    1830.9 1841.01787.4 1825.8

    CS 681.0 687.2 691.6 696.0 700.2 704.4 708.7 713.3 688.9 706.6PCGDPD 2.42 1.44 1.46 1.43 1.54 1.64 1.73 1.81 1.69 1.68

    1999 2000 1999 2000GDPR

    1851.01860.9 1870.7 1880.9 1891.0 1900.9

    1910.6 1920.41865.9 1905.7

    CS 717.8 722.3 726.8 731.8 736.4 741.0 745.7 750.7 724.7 743.5PCGDPD 1.88 1.94 2.00 2.05 2.09 2.13 2.16 2.20 1.97 2.15

    1997 1998 1997 1998GDPR 1787.4 1825.8 1775.4 1784.9 1789.8 1799.6 1810.6 1820.9 1830.9 1841.0CS 688.9 706.6 681.0 687.2 691.6 696.0 700.2 704.4 708.7 713.3PCGDPD 1.69 1.68 2.42 1.44 1.46 1.43 1.54 1.64 1.73 1.81

    1999 2000 1999 2000GDPR 1865.9 1905.7 1851.0 1860.9 1870.7 1880.9 1891.0 1900.9 1910.6 1920.4CS 724.7 743.5 717.8 722.3 726.8 731.8 736.4 741.0 745.7 750.7PCGDPD 1.97 2.15 1.88 1.94 2.00 2.05 2.09 2.13 2.16 2.20

  • Dated Data Table177

    =

    7882=#H7882=9,

    #$$%=#H7882=9

    Additional Table Options

    ;

    '

    4>

    :

    M

    @

    0;A

    Transformation Methods

    =

    67 +

    H0''

    H

  • 178Chapter 8. Groups

    (?

    .

    >

    Frequency Conversion

    :=

    2$*'*'$2>

    :>

    @QA

    4 =

    '=

    H

    $*' 4,

    ,:

    :F

    , ,:

    :F

    100 y y f( )( ) y f( ) f

  • Dated Data Table179

    .3-'

    =

    1 >

    Formatting Options

    '

    3

    =

    '

    Row Options

    ;G

    :

    ' '

    " >

    "$

    1997 1997GDPR 1775.4 1784.9 1789.8 1799.6 7149.8CS 681.0 687.2 691.6 696.0 2755.7

    1998 1998GDPR 1810.6 1820.9 1830.9 1841.0 7303.3CS 700.2 704.4 708.7 713.3 2826.5

    1997 1997GDPR 1775.4 1784.9 1789.8 1799.6 1775.4CS 681.0 687.2 691.6 696.0 681.0

    1998 1998GDPR 1810.6 1820.9 1830.9 1841.0 1810.6CS 700.2 704.4 708.7 713.3 700.2

  • 180Chapter 8. Groups

    .

    >

    :

    Other Options

    ,'%

    1

    >

    6

    .

    8-'

    2

    Illustration

    " :

    36-0=

    #>36-0

    2$*'*'

    $2(>

    :2$

    *'*'$2B

    #>@#>:A

    1997 1997GDPR 1775.4 1784.9 1789.8 1799.6 1787.4

    1.20 0.54 0.27 0.55 3.19CS 681.0 687.2 691.6 696.0 688.9

    0.95 0.91 0.63 0.64 3.17

    1998 1998GDPR 1810.6 1820.9 1830.9 1841.0 1825.8

    0.61 0.57 0.55 0.55 2.15CS 700.2 704.4 708.7 713.3 706.6

    0.61 0.60 0.60 0.65 2.57

  • Dated Data Table181

    #>>

    2$*'36-0#$$*>

    #$$%#$$*.=

    @*#A

    '

    *'$2>#$$*

    :4 >

    #$$*=# >

    #$$*=7 "

    +>:

    :

    Other Menu Items9 5@AG

    ,,

    (

    .,

    :

    ?

    ?

    *

    5 ?=

    100 1825 1787( ) 1787 2.15

    100 700.2 681.0( ) 681.0 2.82100 704.4 687.2( ) 687.2 2.50

    100 14--- 700.2 681.0

    681.0---------------------------------

    704.5 687.2687.2

    ---------------------------------708.7 691.6

    691.6---------------------------------

    713.3 696.0696.0

    ---------------------------------+ + + 2.57

  • 182Chapter 8. Groups

    Graphs

    G

  • Graphs183

    GLG,

    ,LG3

    ,--

    -",

    3

    ;

    High-Low(-Close)

    >

    >

    DE>

    DE

    J

    >

    DE

    "

    ,>>

    G>

    @A

    P4P@

    #)

    A.

    $)Q

    >>4

    @30#A

  • 184Chapter 8. Groups

    group gr1 cs_f+2*cs_se cs_f-2*cs_se cs

    +

    ,30# .$ #2$+,

    ,=

    :

    Pie Graph

    .

    G

    J

    ,,,,3

    ;>

    Multiple Graphs

    (.$

    /.$

    Line and Bar Graphs

    Scatter

    First series against all

    ?

    .G

    Scatter - Matrix of all pairs (SCATMAT)

    "

    ?

    G2

  • Graphs185

    .G G9)

    9) J

    5 >>+>

    :,

    G?

    G

    ,

    XY line

    LG

    ?L>

    G>

    LG.$

    LG

    . LG

    G2

    G G 1( ) 2

    -10

    -5

    0

    5

    10

    0

    5

    10

    15

    20

    25

    0

    20

    40

    60

    80

    100

    0

    200

    400

    600

    800

    -10 -5 0 5 10 0 5 10 15 20 25 0 20 40 60 80 100 0 200 400 600 800

    log(Body Weight)

    Total Sleeping Time

    Maximum Life Span

    Gestation Time

    G G 1

  • 186Chapter 8. Groups

    Distribution Graphs

    CDF-Survivor-Quantile

    @64A

    :0++1+

    J

    $D64>>E #$%

    Quantile-Quantile

    ::

    :>

    $ #$$

    ;

    >

    :

    >

    ,>

    -74>

    4

    group dist @rnorm @rtdist(5) @rextreme @rlogit @rnd

    6.t) ;

    6. /.$ 0.$ 1+1

    .-7-

    :-7

    @(

    ,A>

    0

    2

    4

    6

    8

    -3 -2 -1 0 1 2 3

    Quantile of @RNORM

    Qua

    ntile

    ofS

    LEE

    P2

    0

    2

    4

    6

    8

    -4 -2 0 2 4

    Quantile of @RTDIST(5)

    Qua

    ntile

    ofS

    LEE

    P2

    0

    2

    4

    6

    8

    -4 -2 0 2

    Quantile of @REXTREME

    Qua

    ntile

    ofS

    LEE

    P2

    0

    2

    4

    6

    8

    -4 -2 0 2 4

    Quantile of @RLOGIT

    Qua

    ntile

    ofS

    LEE

    P2

    0

    2

    4

    6

    8

    0.0 0.2 0.4 0.6 0.8 1.0

    Quantile of @RND

    Qua

    ntile

    ofS

    LEE

    P2

  • Descriptive Stats187

    . >>

    -76.

    Descriptive Stats

    6

    %

    @A

    )

    @A

    >

    Tests of Equality

    "

    2D5E

    #9*

    Example

    ",

    #$)8H#$$7;

    @

    77A

    ,:

    4;,>

    ;

  • 188Chapter 8. Groups

  • N-Way Tabulation189

    >

    %

    Group into Bins If

    .>

    ,

    '

    ,

    2

    /"'

    ,

    ?

    ),

    #887.

    ,

    NA Handling

    1'

    *2-

    +"

    Layout

    *

    ,,

    ,+>

    Output

    >

    I

    r c

    2

    i j k, ,

    i j k, ,( ) nijk N nijkk

    j

    i=

  • 190Chapter 8. Groups

    *I

    I

    I

    >

    @*7A

    4 =

    @*2A

    Chi-square tests

    .$+3' >

    Overall (unconditional) independence among all series in the group

    '

    =

    @*9A

    !

    =

    i j k, ,( )

    nijk nijki N nijk

    j N nijk

    k N N=

    nijk

    nijk* nijk*i Nk* nijk*

    j Nk* Nk*=

    Nk

    * k*

    2

    Pearson 2ni j k, , ni j k, ,( )

    2

    ni j k, ,---------------------------------------

    Likelihood ratio 2 ni j k, ,ni j k, ,

    ni j k, ,-------------

    logi j k, ,=

    i j k, ,=

    nijk nijk

    2

    I 1( ) J 1( ) K 1( ) I J K, ,

  • N-Way Tabulation191

    .("3!+.;+"00.6

    +("0+.+3=

    )

    Conditional independence between series in the group

    .'

    J

    .

    - =

    @*)A

    @*&A

    @*%A

    rc

    +

    8#

    (

    Tabulation of LWAGE and UNION and MARRIEDDate: 10/20/97 Time: 15:27Sample: 1 1000Included observations: 1000

    Tabulation Summary

    Variable CategoriesLWAGE 5UNION 2MARRIED 2Product of Categories 20

    Test Statistics df Value ProbPearson X2 4 174.5895 0.000000Likelihood Ratio G2 4 167.4912 0.000000

    WARNING: Expected value is less than 5 in 40.00% of cells (8 of 20).

    I 5= J 2=K 2=

    2

    2

    Phi coefficient 2N=

    Cramers V 2

    min r c,{ } 1( )N( )=

    Contingency coefficient 2

    2

    N+( )=

    min r c,( )N

  • 192Chapter 8. Groups

    1>>

    Correlations, Covariances, and Correlogram

    ; >

    2

    % #)&

    Cross Correlations

    >

    @**A

    Table 1: Conditional table for MARRIED=0:

    UNIONCount 0 1 Total

    [0, 1) 0 0 0[1, 2) 167 8 175

    LWAGE [2, 3) 121 44 165[3, 4) 17 2 19[4, 5) 0 0 0Total 305 54 359

    Measures of Association ValuePhi Coefficient 0.302101Cramer's V 0.302101Contingency Coefficient 0.289193

    Table Statistics df Value ProbPearson X2 2 32.76419 7.68E-08Likelihood Ratio G2 2 34.87208 2.68E-08

    Note: Expected value is less than 5 in 16.67% of cells (1 of 6).

    x y

    rxy l( )cxy l( )

    cxx 0( ) cyy 0( )-------------------------------------------- where l, 0 1 2 ,,,= =

  • Cointegration Test193

    @*$A

    +,

    8

    >

    Cointegration Test

    K

    78K

    Granger Causality

    >

    . I>

    !M

    ?

    3@#$&$A

    :

    3>

    : I+

    >:J 3 3

    .D 3 E

    3

    (.2- ,>

    .

    G,

    '

    cxy l( )xt x( ) yt l+ y( )( ) T

    t 1=

    T l

    l 0 1 2 , , ,=

    yt y( ) xt l x( )( ) Tt 1=

    T l+

    l 0 1 2 ,,,=

    =

    2 T

    x y

    y y

    x y x x

    y x

    x y y x

    x y y

    x

    l

  • 194Chapter 8. Groups

    @*#8A

    F>(

    3>

    4 36-

    .3 @

    A,@0A

    :

  • Commands195

    G

    /&2!!'"

    '"0G

    '"0J

    78>

    '"0'

    Commands

    G

    4

    30-#

    grp1.scat

    3-P("3:

    gp_wage.testbet(med)

    30-P"0;#7

    grp_macro.cross(12)

  • 196Chapter 8. Groups

  • Chapter 9. Statistical Graphs Using Series and Groups

    ' .

    %>

    ?

    ?(

    >

    '?>

    4 ,(>

    Distribution Graphs of Series

    >

    ?

    CDF-Survivor-Quantile

    >

    :

    0+

    .$ 0++1!

    C 0

    >

    @64A64

    @$#A

    C >

    r:64=

    @$7A

    r

    Fx r( ) Pr x r( )=

    Sx r( ) Pr x r>( ) 1 Fx r( )= =

  • 198Chapter 9. Statistical Graphs Using Series and Groups

    C 1:4 >

    :

    @$2A

    :64J

    :

    ? 64

    C 64:

    Standard Errors

    )

    $)Q

    @#$*8

    ##9H##&A+

    :>

    Options

    '6464:

    3N64r

    64

    ?

    0,@A

    ;

    '(

    1

    ,

    0 q 1< < qx q( ) x

    Pr x x q( )( ) q

    Pr x x q( )( ) 1 q

    r 1 2( ) N

    r N

    r N 1+( )

    r 3 8( ) N 1 4+( )

    r 1 3( ) N 1 3+( )

    N

  • Distribution Graphs of Series199

    Quantile-Quantile

    :>:@A>

    @#$$9A::

    .>

    .>

    ( 0.$ 1+1!-

    G:

    =

    C 1>

    C 8'0:

    ?

    C "

    ,

    C ,2

    C ">.@A ,

    B

    G:,

    .'>

    G:

    J

    :

    64>>J

    ,

    4@#$$9A@#$*2

    &A

    Illustration

    :>

    ,

    ,:

  • 200Chapter 9. Statistical Graphs Using Series and Groups

    5, 0

    .$ 1+1!@A=

    .?

    >

    ,.

    ,

    >

    ,>

    ,,.

    >

    ,

    .>

    ':

    4

    >#8)8

    4F@#8)8A

    series fdist=@rfdist(10,50)

    , 0.$ 1+

    1!.

    @fdistA

    -4

    -2

    0

    2

    4

    0 20 40 60 80

    hourly wage

    Nor

    mal

    Qua

    ntile

    -4

    -2

    0

    2

    4

    0 1 2 3 4 5

    log of hourly wageN

    orm

    alQ

    uant

    ile

    F

  • Distribution Graphs of Series201

    ,F@#8)8A

    Kernel Density

    ,

    >

    G

    0 #2

    ,

    D EDE@#$*&A

    >

    , =

    @$9A

    @A

    ,

    ( 0.$ (0-!M6

    ,=

    C (,

    ', =

    0

    1

    2

    3

    4

    0 1 2 3 4 5

    Quantile of LWAGE

    Qua

    ntile

    ofF

    DIS

    T

    X x

    x( ) 1Nh-------- K

    x Xih

    ----------------

    i 1=

    N

    =

    N h K

    K

  • 202Chapter 9. Statistical Graphs Using Series and Groups

    u, ,?

    C ;$ J

    1

    @#$*&A>

    @A>

    @$)A

    NsR:>@#$*&:22#Ak>>,@+#$*$J5\

    #$$#A>

    ,

    ,8'

    "

    >

    @#$*&29A,>

    ;&;$

    .,'

    8)hh#)h

    ,@A

    !@0A

    +@3A

    1@A

    34--- 1 u2( )I u 1( )

    1 u( ) I u 1( )( )

    12--- I u 1( )( )

    12

    ------------12---u2

    exp

    1516------ 1 u2( )

    2I u 1( )

    3532------ 1 u2( )

    3I u 1( )

    4---

    2---u

    I u 1( )cos

    I

    h

    h 0.9kN 1 5 min s R 1.34,( )=

  • Distribution Graphs of Series203

    C 'GM

    M

    :>=

    @$&A

    '

    >

    @,A@,A>

    C /$1'?,;2

    4

    @#$$9A:

    4

    "

    ,

    :>

    !

    Illustration

    ",6&$

    .,@#$$&A6,=

    6

    ,

    0.$ (0-!

    =

    M 100=XL XU f x( )

    xi XL iXU XLM

    ---------------------- for i,+ 0 1 M 1, ,= =

    Xjj 1 2 N, , ,= xiO NM( )

    0

    2

    4

    6

    8

    10

    12

    14

    7.6 7.8 8.0 8.2 8.4 8.6 8.8

    Series: CDRATESample 1 69Observations 69

    Mean 8.264203Median 8.340000Maximum 8.780000Minimum 7.510000Std. Dev. 0.298730Skewness -0.604024Kurtosis 2.671680

    Jarque-Bera 4.505619Probability 0.105103

  • 204Chapter 9. Statistical Graphs Using Series and Groups

    @#$$&

    2A3

    ,88* 0.$ (

    0-!4 =

    +"&$

    ,,=

    0.0

    0.4

    0.8

    1.2

    1.6

    7.5 8.0 8.5 9.0

    CDRATE

    Kernel Density (Epanechnikov, h = 0.2534)

  • Scatter Diagrams with Fit Lines205

    .

    DE%)*8*)

    Scatter Diagrams with Fit Lines

    ? >

    $2$2$4

    $(

    Scatter with Regression

    G

    L@A

    0.0

    0.5

    1.0

    1.5

    2.0

    7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8

    CDRATE

    Kernel Density (Normal, h = 0.0800)

  • 206Chapter 9. Statistical Graphs Using Series and Groups

    =

    ab+1 >

    ?

    C .'4

    ,

    ?'

    C .>'

    (,('>

    G

  • Scatter Diagrams with Fit Lines207

    4)>

    :0ab?

    :

    @$%A

    :

    @$*A

    @

    ;Am ;

    @A:>

    ,, )

    @#$$2A

    Scatter with Nearest Neighbor Fit

    1.

    J

    *@,*A:

    @#$$2#$$9A"

    :

    43

    M,@#$*2A

    Method

    G

    ri yi a xi b( )2

    i 1=

    N

    yi xi r

    r 1 ei2 36m2( )( )

    2for ei 6m 1

    ,;2@4#$$9A

    ,>

    3532------ 1 u2( )

    3I u 1( )

    4---

    2---u

    I u 1( )cos

    I

    h 0.15 XU XL( )=

    XU XL( )

    M 100=XL XU[ , ]

    xi XL iXU XLM

    ---------------------- for i+ 0 1 M 1, ,= =

    xi Xj Yj,( )j 1 2 N, , ,=

    Xj

  • 212Chapter 9. Statistical Graphs Using Series and Groups

    ,4

    '

    Y

    >

    .,;&;$'P

    PP5

    8) #) >

    Example

    " 5@#$$#A

    series x=rnd

    series y=sin(2*pi*x^3)^3+nrnd*(0.1^.5)

    G__GL,=

    DEG

    +, >

    GLG

    LJ

    5LG,

    . .$ $2$4

    $(

    -2

    -1

    0

    1

    2

    0.0 0.2 0.4 0.6 0.8 1.0

    Y

    X

    x 0.6= x 0.9=x 0.8=

  • Commands213

    '

    =

    1

    ,,

    LN#;

    group aa age lwage

    aa.linefit(yl,xl)

    ""("3"3

    ("3"3

    -2

    -1

    0

    1

    2

    0.0 0.2 0.4 0.6 0.8 1.0

    X

    Y

    LOESS Fit (degree = 1, span = 0.3000)

    -2

    -1

    0

    1

    2

    0.0 0.2 0.4 0.6 0.8 1.0

    XY

    Kernel Fit (Epanechnikov, h = 0.1494)

  • 214Chapter 9. Statistical Graphs Using Series and Groups

    aa.linefit(yl,d=3)

    ("3"3

    aa.nnfit

    aa.kerfit

    @A>,>

    ""

  • Chapter 10. Graphs, Tables, and Text Objects

    '

  • 216Chapter 10. Graphs, Tables, and Text Objects

    Graph Type

    +

    @ A

    4

    .

    .$*-

    =

    C ,.$

    C &,

    -

    C ;.$

    C &;

    C /";E,

    C 02?

  • Graphs217

    C A>

    @A

    *

    >>

    C $>

    Graph Attributes

    G.$

    , G

    ???

    Bars and Lines

    G'

    ,,,

    .$'>

    (

    '

    Graph Scaling Options

    2

    2>

    =

    C :

    C $2$: ?

    C ,2$2

    C :0?

  • 218Chapter 10. Graphs, Tables, and Text Objects

    8/2

    3

    4

    @A4LG

    ?

    @A

    +

    '

    Line Graph Options

  • Graphs219

  • 220Chapter 10. Graphs, Tables, and Text Objects

    L>

    G>

    "

    LN9GN2>

    >>

    >

    G

    >

    ",

    ,,

    Adding Shading

    G

    4

    .

    ,$

    Customizing Axis Labels

    .,?

    ,,

    ,

    G

    ,,

    4 33 3

  • Graphs221

    Customizing Legends

    .,

    =

    C

    C

    J-

    C ,,,,2;"

    C

    C -

    4

    6,

    G

    Removing Graph Elements

    ?

    4

    , "

    -

    Graph Templates

    5

    ,

  • 222Chapter 10. Graphs, Tables, and Text Objects

    Graph Commands

    4 >

    '

    ?

    4

    Multiple Graph Objects

    ,

  • Printing Graphs223

    A

  • 224Chapter 10. Graphs, Tables, and Text Objects

    Printing Graphs as PostScript Files

    '(

    (,!($)

    4, 2 6,

    ,",,-(

    5-K9"

    (-@,>

    A

    ,

    ;4.=(

    ((

    DE

    (

    '

    Copying Graphs to Other Windows Programs

    G'

    (

    , -

    'J3

    G

    (,G:

    (

    ,>>

    .

    /&'

    .

    ((-

    ?G

    ,

    Tables

    "

    ;K

    =

  • Copying Tables to Other Windows Programs225

    Table Options

    "

    >>

    .>

    C

    C )+0@)0A

    C $@$A>

    C @A

    "$"+

    +

    J$

    F'

    GF'-

  • 226Chapter 10. Graphs, Tables, and Text Objects

    ",

    ' @04A

    >>'

    (

    04

    =

    .

    Text Objects

    :L>##

  • Commands227

    ?30-#

    30"#

    freeze(gra1) grp1.scat

  • 228Chapter 10. Graphs, Tables, and Text Objects

  • Part III. Basic Single Equation Analysis

    ##H#)':

    C

    ##10B

    :'

    C

    #7"0B:

    >:::

    C

    #20B:>

    :=

    "0""0."L

    C

    #9B'

    C

    #)4B'

    :

    "::,>

    -.'-'

    :

  • 230

  • Chapter 11. Basic Regression

    :>

    :

    :'=>

    :

    ?::>:@A

    :"0."F"0."L?

    @3A3"05:

    :

    G ,

    ::

    ,

    @A=

    C -,0@#$$#A

    C K6+@#$$%A

    C 3@#$$%A

    C 6M@#$$2A

    (

    ?

    Equation Objects

    :'(

    ):

  • 232Chapter 11. Basic Regression

    >>:::

    >:

    Specifying an Equation in EViews

    (:

    G

    =:>

    .

    >

    :=@>

    A@>

    A>

    :=>

    J

    Specifying an Equation by List

    :

    :4

    4

    .+

    :=

    cs c inc

    +>'

    '>

    @:A

    ,

    :.#

    >

    G>

  • Specifying an Equation in EViews233

    B4

    =

    cs cs(-1) c inc

    '.+

    @#A@7A

    .+@2A

    Gto4

    cs c cs(-1 to -4) inc

    @>#A@>7A@>2A@>9A.+.T

    ,?4

    cs c inc(to -2) inc(-4)

    .+.+@>#A.+@>7A.+@>9A

    G>.>

    4

    log(cs) c log(cs(-1)) ((inc+inc(-1)) / 2)

    .+

    ,

    .'4>

    ,,+ 0>,

    (>

    , 3!:

    J

    Specifying an Equation by Formula

    G:

    :

    ":' >

    :

  • 234Chapter 11. Basic Regression

    ':

    :

    (:'::

    4

    log(cs) c log(cs(-1)) log(inc)

    '

    log(cs) = c(1) + c(2)*log(cs(-1)) + c(3)*log(inc)

    ::

    N=

    log(urate) + c(1)*dmr = c(2)

    :=

    @###A

    '?>>:

    .:

    :.:' >

    4 :

    c(1)*x + c(2)*y + 4*z

    '?:

    @@#AOLY@7AOGY9ORA('

    @0>:A

    ::

    :4

    x + c(1)*y = c(2)*z

    '@#A@7A?:@LY@#AOGH

    @7AORA:=

    x = -c(1)*y + c(2)*z

    :

    4

    >

    L

    =

    urate( )log c 1( )dmr c 2( )=

  • Estimating an Equation in EViews235

    y = c(1) + c(2)*x + c(3)*x(-1) + c(4)*x(-2) +(1-c(2)-c(3)-

    c(4))*x(-3)

    '

    :4

    #7D+:E 7&8

    G

    !/"++'

    ,(./"

    ''+

    >:

    :>

    :

    ::>

    :3"05

    +:

    :"0"

    Estimation Sample

    G'

    ,>

  • 236Chapter 11. Basic Regression

  • Equation Output237

    Equation Output

    (,(:':

    =

    ! =

    @##7A

    yT>XT

    k k> T>>

    Tk>

    .y@#[email protected]

    Coefficient Results

    Regression Coefficients

    DE:

    b;

    @##2A

    .:D'E

    J:'

    @#A@7A

    4

    .

    B

    Dependent Variable: LOG(M1)Method: Least SquaresDate: 08/18/97 Time: 14:02Sample: 1959:01 1989:12Included observations: 372

    Variable Coefficient Std. Error t-Statistic Prob.

    C -1.699912 0.164954 -10.30539 0.0000LOG(IP) 1.765866 0.043546 40.55199 0.0000

    TB3 -0.011895 0.004628 -2.570016 0.0106

    R-squared 0.886416 Mean dependent var 5.663717Adjusted R-squared 0.885800 S.D. dependent var 0.553903S.E. of regression 0.187183 Akaike info criterion -0.505429Sum squared resid 12.92882 Schwarz criterion -0.473825Log likelihood 97.00980 F-statistic 1439.848Durbin-Watson stat 0.008687 Prob(F-statistic) 0.000000

    y X +=

    T 372= k 3=

    b XX( ) 1 Xy=

  • 238Chapter 11. Basic Regression

    ?

    Standard Errors

    DE

    B>

    .

    72

    $)#88

    @##9A

    :

    G

    /"

    t-Statistics

    t>:?t>

    t>:

    ?

    Probability

    t>

    , 3p>

    ?4

    )Qp>8),

    >

    >'

    4 12?t>

    var b( ) s2 XX( ) 1 s2; T k( ) ; y Xb= = =

    T k

  • Equation Output239

    Summary Statistics

    R-squared

    0>:@ A

    .

    :?

    .

    >

    >:

    '@A

    @##)A

    @>A

    Adjusted R-squared

    ;

    .

  • 240Chapter 11. Basic Regression

    @##*A

    Log Likelihood

    ',@A

    ,

    ,,>

    :

    ,

    @##$A

    (''

    Durbin-Watson Statistic

    6>(>

    @###8A

    K6+@#$$%6)A>

    6>(

    "6(7

    6(

    #2 6>(

    :

    .

    #2Q>

    1>3

    6>(

    Mean and Standard Deviation (S.D.) of the Dependent Variable

    y=

    yi Xib( )2

    t 1=

    T

    =

    lT2--- 1 2( )log T( )log+ +( )=

    DW

    t t 1( )2

    t 2=

    T

    t2

    t 1=

    T

    -------------------------------------=

  • Equation Output241

    @####A

    Akaike Information Criterion

    ",,.@".A=

    @###7A

    ,@:@##$A798A

    ".>B".

    4 >

    "."

    4 )$$

    Schwarz Criterion

    ?@A".>

    =

    @###2A

    F-Statistic and Probability

    +>@

    A?4:+>

    @###9A

    !+>

    p>6+7>

    +>.p>8)?

    ?++>>

    +>

    Working With Regression Statistics

    :

    V>G

    .

    +"

    y ytt 1=

    T

    T sy yt y( )2 T 1( )t 1=

    T

    =;=

    AIC 2l T 2k T+=

    l

    SC 2l T k Tlog( ) T+=

    FR

    2k 1( )

    1 R2( ) T k( )------------------------------------------=

    k 1 T k

  • 242Chapter 11. Basic Regression

    ,V>=>

    Keywords that return scalar values

    Keywords that return vector or matrix objects

    .:

  • Working with Equations243

    G6>(>

    :

    (:(:#

    4

  • 244Chapter 11. Basic Regression

    +

    4

    4.$

    '

    >

    .$

    :

    .$

    >

    /"6

  • Working with Equations245

    Default Equation

    4'

    :

    #)

    #972

    !:,G:>

    ::,

    ;:

  • 246Chapter 11. Basic Regression

    t>:#

    eq1.@tstats(2)

    #

    sym ccov1 = eq1.@cov

    D0E 79)

    Storing and Retrieving an Equation

    ">,

    ':,

    G:,>

    2&

    .>

    !:

    8''34

  • Estimation Problems247

    "@coefs

    :@

    A4

    series cshat=eq1.@coefs(1)+eq1.@coefs(2)*gdp

    '

    :

    equation eq01.ls y=c(10)+b(5)*y(-1)+a(7)*inc

    1"

    eq01.@coefs(1)@#8A

    eq01.@coefs(2)1@)A

    eq01.@coefs(3)"@%A

    @stderrs:@"

    " )&)A@coefs

    .:

    4

    1"

    equation eq02.ls cs=beta(1)+beta(2)*gdp

    series cshat=beta(1)+beta(2)*gdp

    1""@coefs

    87"

    1" 8''3:

    +':eq02.beta(1)

    eq02.beta(2AG eq02.@coefs(1)eq02.@coefs(2)

    Estimation Problems

    Exact Collinearity

    .'

    .'D+ E

    (,">

    ! X>

    ,;

  • 248Chapter 11. Basic Regression

    G >

    "

    4

    :>

    y c x @seas(1) @seas(2) @seas(3) @seas(4)

    'D+ E:>

    =

    c = @seas(1) + @seas(2) + @seas(3) + @seas(4)

    .

    ,

    Commands

    :

  • Chapter 12. Additional Regression Methods

    :,

    >:@A

    :?@3A+>

    :J

    #$

    -

    @"0A

    @"A

    #2

    Weighted Least Squares

    ,,w

    G

    :w,>

    ':

    ?

    ,>

    ?':

    >

    :

    ?>>:

    @#7#A

    k> . W

    w?

    yX>>

    :

    @#77A

    @#72A

    ::

    1& 3!,=,36,

    S ( ) wt2yt xt( )

    2

    t=

    bWLS XWWX( )1XWWy=

    WLS s2XWWX( ) 1=

  • 250Chapter 12. Additional Regression Methods

    /7 :

    ,2$, *,

    4,2$%,

    (,(:

    '

    @#79A

    Dependent Variable: LOG(X)Method: Least SquaresDate: 10/15/97 Time: 11:10Sample(adjusted): 1891 1983Included observations: 93 after adjusting endpointsWeighting series: POP

    Variable Coefficient Std. Error t-Statistic Prob.

    C 0.004233 0.012745 0.332092 0.7406LOG(X(-1)) 0.099840 0.112539 0.887163 0.3774LOG(W(-1)) 0.194219 0.421005 0.461322 0.6457

    Weighted Statistics

    R-squared 0.016252 Mean dependent var 0.009762Adjusted R-squared -0.005609 S.D. dependent var 0.106487S.E. of regression 0.106785 Akaike info criterion -1.604274Sum squared resid 1.026272 Schwarz criterion -1.522577Log likelihood 77.59873 F-statistic 0.743433Durbin-Watson stat 1.948087 Prob(F-statistic) 0.478376

    Unweighted Statistics

    R-squared -0.002922 Mean dependent var 0.011093Adjusted R-squared -0.025209 S.D. dependent var 0.121357S.E. of regression 0.122877 Sum squared resid 1.358893Durbin-Watson stat 2.086669

    ut wt yt xtbWLS( )=

  • Heteroskedasticity and Autocorrelation Consistent Covariances251

    @A

    @#7)A

    40.6

    .

    ,.

    ,t $

    :"0"+

    Heteroskedasticity and Autocorrelation Consistent Covariances

    (,,>

    :;>

    ,;

    1:5"=

    C !(,+>(5"

    >

    C ,,>

    4 :

    (+>(

    Heteroskedasticity Consistent Covariances (White)

    (@#$*8A, >

    ,

    ,( =

    @#7&A

    Tk :

    ut yt xtbWLS=

    wt

    WT

    T k------------ XX( ) 1 ut

    2xtxt

    t 1=

    T

    XX( ) 1=

    ut

  • 252Chapter 12. Additional Regression Methods

    '(

    ;;::

    + ,, #&-

    ,$",(:

    ':(I>

    G'(

    =

    HAC Consistent Covariances (Newey-West)

    ( :>

    +(@#$*%A

    ,

    ,+>(

    @#7%A

    @#7*A

    q; 4+(

    'q

    @#7$A

    +>( ,

    #&--+>

    Dependent Variable: LOG(X)Method: Least SquaresDate: 10/15/97 Time: 11:11Sample(adjusted): 1891 1983Included observations: 93 after adjusting endpointsWeighting series: POPWhite Heteroskedasticity-Consistent Standard Errors & Covariance

    Variable Coefficient Std. Error t-Statistic Prob.

    C 0.004233 0.012519 0.338088 0.7361LOG(X(-1)) 0.099840 0.137262 0.727369 0.4689LOG(W(-1)) 0.194219 0.436644 0.444800 0.6575

    NWT

    T k------------ XX( ) 1 XX( ) 1=

    T

    T k------------ ut

    2xtxt

    t 1=

    T

    1 vq 1+-------------

    xtutut v xt v xt v ut v utxt+( )t v 1+=

    T

    v 1=

    q

    +

    =

    ut

    q floor 4 T 100( )2 9( )=

  • Two-Stage Least Squares253

    Two-Stage Least Squares

    ">>

    .;

    >

    =

    C >:

    C 0>

    4

    "

    >

    : >

    @#A

    :@7A>

    >>

    >:@A"

    >:.

    ;

    :

    >

    G'

    :Z

    yX >:

    @#7#8A

    @#7##A

    @:A

    bTSLS XZ ZZ( )1ZX( )

    1XZ ZZ( ) 1 Zy=

    TSLS s2XZ ZZ( ) 1 ZX( )

    1=

    s2

  • 254Chapter 12. Additional Regression Methods

    Estimating TSLS in EViews

    >::

    3!1& 3!*,/$%

    .

    >

    ,=

    C .

    >

    :,

    6M@#$$9AK6+@#$$%A>

    C 4>

    C '

    4

    :>

    @;+A@36-A@;+@H#AA

    @.A@A36->

    G @3A

    @A.

    G:

    cons c gdp cons(-1) time

  • Two-Stage Least Squares255

    c gov cons(-1) time lm

    :

    @A@A:

    4:>

    @;+@H#A.A

    :

    +'>

    Output from TSLS

    1;3@A;3@36-A

    ;3@@>#AA;3@36-@>#AA=

    '

    t>p>

    >

    ##14

    K6+@#$$%

    2))H

    2)*A6M@#$*9

    77#H779A

    ' >

    4 >

    @#7#7A

    >

    Dependent Variable: LOG(CS)Method: Two-Stage Least SquaresDate: 10/15/97 Time: 11:32Sample(adjusted): 1947:2 1995:1Included observations: 192 after adjusting endpointsInstrument list: C LOG(CS(-1)) LOG(GDP(-1))

    Variable Coefficient Std. Error t-Statistic Prob.

    C -1.209268 0.039151 -30.88699 0.0000LOG(GDP) 1.094339 0.004924 222.2597 0.0000

    R-squared 0.996168 Mean dependent var 7.480286Adjusted R-squared 0.996148 S.D. dependent var 0.462990S.E. of regression 0.028735 Sum squared resid 0.156888F-statistic 49399.36 Durbin-Watson stat 0.102639Prob(F-statistic) 0.000000

    ut yt xtbTSLS=

    s2

    ut2

    T k( )t=

  • 256Chapter 12. Additional Regression Methods

    :

    >

    (4

    :

    :

    Weighted TSLS

    G

    2$, *,

    (>:

    :>

    '

    @#7#2A

    @#7#9A

    TSLS with AR errors

    G

  • Two-Stage Least Squares257

    >

    First-order AR errors

    =

    @#7#)A

    .

    .:4@#$%8A

    ,>

    .

    @#7#&A

    ':4@#$*9A"

    >>

    Dependent Variable: LOG(CS)Method: Two-Stage Least SquaresDate: 10/15/97 Time: 11:42Sample(adjusted): 1947:2 1995:1Included observations: 192 after adjusting endpointsConvergence achieved after 4 iterationsInstrument list: C LOG(CS(-1)) LOG(GDP(-1))

    Variable Coefficient Std. Error t-Statistic Prob.

    C -1.420705 0.203266 -6.989390 0.0000LOG(GDP) 1.119858 0.025116 44.58782 0.0000

    AR(1) 0.930900 0.022267 41.80595 0.0000

    R-squared 0.999611 Mean dependent var 7.480286Adjusted R-squared 0.999607 S.D. dependent var 0.462990S.E. of regression 0.009175 Sum squared resid 0.015909F-statistic 243139.7 Durbin-Watson stat 1.931027Prob(F-statistic) 0.000000

    Inverted AR Roots .93

    yt xt wt ut+ +=

    ut 1ut 1 t+=

    xt wtzt

    wt

    yt 1 xt 1 wt 1, ,( )

    wt zt yt 1 xt 1 wt 1, , , ,( )

  • 258Chapter 12. Additional Regression Methods

    Higher Order AR errors

    "0@#A 4

    "0@9A

    @#7#%A

    ."0#9

    @#7#*A

    (

    @4@#$*97#9A

    6M@#$$2

    777>779AA.

    "0>

    .>'

    J

    >

    Examples

    >:>

    >G>:

    cons c gdp ar(1)

    c gov log(m1) time cons(-1) gdp(-1)

    +@;+@H#A36-@H#AA

    cons c cons(-1) gdp ar(1)

    "

    c gov log(m1) time cons(-1) cons(-2) gdp(-1)

    5>>

    wt zt yt 4 xt 4 wt 4, , , ,( )

    wt zt yt 1 y, , t 4 xt 1 x, , t 4 wt 1 w, , t 4, , , ,( )

  • Two-Stage Least Squares259

    cons c gdp ar(1) ar(2) ar(3) ar(4)

    .DE

    c gov log(m1) time cons(-1) cons(-2) cons(-3) cons(-4) gdp(-1)

    gdp(-2) gdp(-3) gdp(-4)

    "@A

    c gov log(m1) time

    3;'

    ;3@#A.;+J36-

    TSLS with MA errors

    G>:"

    "

    >

    Illustration

    >:

    >G>:

    cons c gdp ma(1)

    c gov log(m1) time

    .;+36->

    Technical Details

    "0'>

    @,

    A

    :

    "

    "

    G

  • 260Chapter 12. Additional Regression Methods

    Nonlinear Least Squares

    @#7#$A

    :?:=

    @#778A

    (

    J

    4

    @#77#A

    :

    .:

    @#777A

    :?>>:

    (::

    +:?>>:

    (

    >=

    @#772A

    @

    GXA

    @#779A

    4

    -,0@#$$#

    72#>79)A6M@#$$2A

    Estimating NLS Models in EViews

    .'

    :'

    ::

    yt f xt ,( ) t+=

    f xt

    S ( ) yt f xt ,( )( )2

    t y f X ,( )( ) y f X ,( )( )= =

    f

    yt 1 2 Ltlog 3 Ktlog t+ + +=

    yt 1Lt2Kt

    3 t+=

    G ( )( ) y f X ,( )( ) 0=

    G ( ) f X ,( )

    NLLS s2G bNLLS( )G bNLLS( )( )

    1=

    bNLLS

  • Nonlinear Least Squares261

    3:

    : ,(',

    ""

    Specifying Nonlinear Least Squares

    4:

    ' G

    @@#A@7A@29A@*%AA>

    4

    y = c(1) + c(2)*(k^c(3)+l^c(4))

    >

    /"++' ''

    G

    4 4>

    y = cf(11) + cf(12)*(k^cf(13)+l^cf(14))

    4

    G=

    y = c(11) + c(12)*(k^cf(1)+l^cf(2))

    4

    .'4

    y = (c(1)*x + c(2)*z + 4)^2

    '?

    @#77)A

    .:

    4

    (c(1)*x + c(2)*z + 4)^2

    yt c 1( )xt c 2( )zt 4+ +( )2

    t+=

    S c 1( ) c 2( ),( ) yt c 1( )xt c 2( )zt 4+ +( )2( )

    2

    t=

  • 262Chapter 12. Additional Regression Methods

    ' '?

    @#77&A

    (':

    :