Welcome Guestlogin to KGsePGregister at KGsePG email | FAQs

Regression Models continued specfication dummy variables and controlling for seasonaliity

download

    1 of 36

    Regression Models continued specfication dummy variables and controlling for seasonaliity



    Regression Models continued specfication dummy variables and controlling for seasonaliity - Transcript


    Business Forecasting

    Lecture 5 Misspecification dummy variable and seasonality

    1

    Lecture Overview


    Autocorrelation continued Normality Multicollinearity Functional Forms Ramsey Reset Test Dummy variables


    Controlling for seasonality in the data

    Chapter 7 8 of Business Forecasting BF Chapter 6 Elements of

    Forecasting

    2

    Breusch Godfrey LM test
    DW test can only test for 1st order autocorrelation and can

    NOT be used when one of the explanatory variables is a lagged dependent variable

    BG LM test for autocorrelation H0 NO autocorrelation H1 autocorrelation exists Eg F stat 3 4 p value 0 03 Again we can use the p value and compare it with If p value alpha Reject the null If p value alpha DO NOT reject the null BG test like white s test and method only valid in LARGE sample e g n 50 3

    Breusch Godfrey LM test Beef example

    BG test like white s test and method only valid in LARGE

    sample e g n 50

    4

    Autocorrelation Consequences Solutions
    Same as with Hetero standard errors are wrong

    and b s are not the best but still unbiased Solutions Use Newy West method to correct standard errors Use another estimation technique Non linear least squares In Eviews we can add AR 1 to the list of independent variables and it estimates the relationship between the residuals of the current period and the residuals from the previous period
    5

    Autocorrelation Solution

    6

    Assumption 5 Normally distributed Errors Residuals Beef Example

    7

    Other Problems Multicollinearity
    When two or more of the X variables are highly correlated giving redundant information Signs of serious multicollinearity
    The

    signs or of some coefficients may be the reverse of those expected from theory or logic The standard errors of the regression coefficients will be high commonly leading to false non rejection of Ho in ttests F test for overall significance leads to the conclusion of significance but individual t tests suggest non significant variables
    8

    multicollinearity examples
    To predict salaries may consider variables years of education age years in management experience on the job length of time with firm To predict world production of crude oil may consider in US energy consumption gross nuclear electricity generation coal production natural gas production rate of fuel use for cars

    9

    Testing for Multicollinearity
    1 Observe correlation matrix of independent variables 2 Run auxiliary regressions


    of each X variable on all the other X variables eg X1 on X2 X3 X2 on X1 X3 etc determine r21 r22 r23 Any r2i 0 8 means serious multicollinearity may exist high correlation between the X variables
    10



    Testing for Multicollinearity Beef example auxiliary regression

    11

    Transformations in Regression
    Not all relationships are likely to be linear therefore it is not

    appropriate to assume they are
    We can transform our dependent or independent variable in order

    to estimate a non linear relationship still using our linear regression framework
    For example assume that Y and X1 s relationship takes a quadratic

    form
    Eg Y 0 1X1 2 X1 2 We can estimate this by creating X2 and estimating the following

    equation Y 0 1X1 2X2 where X2 X1 2
    12

    Transformations
    Any model is still a linear regression model as long

    as the coefficients s enter into the equation in a linear way
    does not enter into the equation in a linear fashion Y 0 X1 1

    The following is not a linear regression model because 1

    A model is a linear economic model if both the dependent

    variable and the independent variables enter in a linear way

    13

    Transformations
    Log log model where both the dependent variable and the

    independent variable are in log form For example with the beef example with may think that Log qbt 0 1log pbt 2log plt 3log ppt 4log inct et

    14

    Ramsey RESET Test
    Choosing the correct functional form is no easy task One method which we use to help us decide whether

    the current functional form is correct is the Ramsey Reset Test The RESET test Regression Specification Error Test is designed to detect not only incorrect functional form but also omitted variables If the chosen model and algebraic form are correct then squared and cubed terms of the fitted or predicted values should not contain any explanatory power for the dependent variable
    15

    Ramsey RESET Test
    We have estimated our model such that the fitted predicted values

    are given by

    Y b0 b1 X 1 b2 X 2 b3 X 3
    One fitted term

    There are two common alternative forms to test for misspecification

    Y 0 1 X 1 2 X 2 3 X 3 Y 2 Y 0 1 X 1 2 X 2 3 X 3 1Y 2 2Y 3
    Two fitted terms The two fitted terms simply tests for an increased number of

    different possible functional forms

    16

    Ramsey RESET Test
    H0 The functional form is correct no omitted

    variables extra terms are statistically not significant
    H1 The functional form is incorrect OR AND there are

    omitted variables extra terms are statistically significant
    F stat P value If p value Reject the null If p value Do not reject the null
    17

    Example beef RESET Test
    Let s look a RESET test on both the linear model and Log log model

    for the beef example Linear model RESET TEST In Eviews equation window View Stability tests Ramsey Reset
    At 5 level p value

    Reject the null

    Two fitted terms

    At the 5 level of significance there is either omitted variables and or incorrect functional form 18

    Example beef RESET Test
    Log Log model RESET TEST In Eviews equation window

    View Stability tests Ramsey Reset
    At 5 level p value

    Reject the null

    Two fitted terms

    At the 5 level of significance there is either omitted variables and or incorrect functional form

    19

    Dummy variables
    So far we have only looked at including quantitative

    explanatory variables in our model age income etc But what about if we want to include qualitative categorical variables sex male or female season summer or winter or spring or autumn etc into our regression For example we might think that males get paid higher wages than female after taking into consideration other factors Or that monthly retail sales depend on not only price we charge but the current month as well
    20

    Dummy variables
    In order to include qualitative variable we construct what we call dummy

    variables Dummy because they only take a value of either 1 or 0 If 2 categories need 1 dummy variable For example male 1 if sex male

    0 if


    sex female

    If 2 categories use more dummy variables

    Eg type of job assembler painter inspector need 2 dummy variables e g assembler 1 if assembler or assembler 0 if painter or inspector painter 1 if painter or painter 0 if assembler or inspector Always need one less dummy than no of categories otherwise perfect multicollinearity problem 21

    Example 1
    Analyze the relationship between hourly wage yrs

    years with the company and also a company analyst wished to include gender as an independent variable to test whether there is any bias against women as far as salary is concerned The model is Y 0 1X1 2X2 where


    Y annual salary per hour X1 dummy variable fem 1 female 0 male X2 yrs years with the company

    22

    Example 1 Wage
    Interpreting coefficients when

    there are dummy variables in the model b0 When a employee is new to the company yrs 0 and fem 0 the expected wage will be 6 62 per hour But what does it mean if Fem 0 Well it means that it s a male b0 When a male employee is new to the company the expected wage will be 6 62 per hour For a 1 unit increase in Fem the wage decreases by 2 48 per hour But what does it mean when Fem increases by 1 i e goes from 0 to 1 This mean it goes from being male to female b1 Compared to males females expected wage will be 2 48 per hour 23 less
    b1

    Modelling for Seasonality using dummy variables
    Remember that seasons are just regular parts of the year



    weekly data 52 seasons monthly data 12 seasons quarterly data 4 seasons Seasons simply act like a categorical variable therefore we use dummy variables in our regression to control for them For example we have the monthly sales of motor vehicles which we think will vary depending on the current month Eg Monthly seasonal dummies 12 months so we need to add 11 dummies variables So we estimate the model
    Salest 0 1S1t 2 S 2t 3 S3t 4 S 4t 5 S5t 6 S 6t 7 S 7 t

    8 S8t 9 S9t 10 S10t 11S11t
    24

    Modelling for Seasonality using dummy variables
    Where S1t is the dummy variable for Jan which is equal to 1 if

    jan and 0 other S2t is equal to 1 for Feb and 0 other

    Only 11 dummy variables in this case we don t include a dummy variable for December

    25

    Interpreting Seasonality using dummy variables
    Interpreting coefficients when there

    are dummy variables in the model b0 When all the explanatory variables are zero the expected sales will be 113604 cars But what does it mean if S1 0 S2 0 S3 0 S11 0 Well it means that it s not Jan Feb Mar Apr May Jun July Aug Sep Oct Nov Therefore it s December b0 For December the expected sales will be 113604 cars
    26

    Interpreting Seasonality using dummy variables
    b1 When S1 increases by 1 unit then the expected sales will

    be decrease by 78735 cars holding all else constant But what does it mean if S1 increases by 1 unit S1 goes from 0 to 1 Well holding all else constant must mean that all seasonal dummies are 0 and therefore changing S1 from 0 to 1 means we are going from December to January b1 The expected sales of cars will be 78735 less in January compared with December holding all else equal

    Note If we included December S12 in our regression then b0

    would not exist given that it s impossible not to be in a month of the year
    27

    Refinements seasonal models
    Adjustments can be made if the number of trading

    days changes between periods Adjustments may be made when we know seasonal effects will vary with the calendar Easter school holidays etc Adjustments can be made if we suspect that our data contains significant outliers To account for all of these factors we just need to increase the complexity of the model
    refer to Elements of Forecasting Ch 6

    28

    Dummy variables used to change slopes
    We have only added dummy variables in a linear way

    so far but we can also use them to change the effect slope of a variable for two different populations In example 1 if we thought that the effect of yrs with the company was different for males and females then we could add another variable to the regression Fem yrs this is sometimes referred to as a dummy interaction term
    Again in terms of seasons we may think that some

    explanatory variables have different effects in different seasons
    29

    Dummy variables continued
    Y 0 1X1 2X2 3X3 where
    Y wage per hour X1 Fem 1 female 0 male


    X2 yrs years with the company X3 Fem yrs dummy variable quantitative variable

    2 is the effect of yrs with the company for males 2 3 is the effect of yrs with company for females 3 is the difference in the effect of experience for females and males
    30

    Dummy variables continued
    b2 For males an extra year with the company increases the wage by 0 05 per hour holding all else constant b2 b3 For females an extra year with the company decreases the wage by 0 0014 per hour holding all else constant b3 Females receive 0 055 less than males for each extra year they have been with the company holding all else equal

    31

    Forecasting for models which use dummy variables
    Again nothing changes with how we forecast

    using dummy variables The only difficulty is working out what value each explanatory variable should take So uses are model for motor car sales if we want to forecast for the number of sales next September
    Salest 0 1S1t 2 S 2t 3 S3t 4 S 4t 5 S5t 6 S 6t 7 S 7 t

    8 S8t 9 S9t 10 S10t 11S11t
    S1 0 S2 0 S3 0 S9 1 S10 0 s11 0
    32

    Forecasting for models which use dummy variables
    So it s just

    going to be

    Predicted

    sales

    113604 384 6 Because all the other coefficients cancel out
    33

    Simpler Models for forecasting seasonal effects Holt Winters Solution
    This is based on three equations an equation to smooth the level an equation to smooth the trend and an equation to smooth the seasonality Refer to last chapter elements of forecasting diebold

    Lt Yt St s 1 Lt 1 Bt 1 Bt Lt Lt 1 1 Bt 1

    St Yt Lt 1 S t s

    34

    Testing with Dummy variables
    Again we can test the coefficients on dummy

    variables just like any other coefficient We can also do joint tests F test to see whether the whole equation changes for different sub samples eg Males and females Consider the wage equation

    35

    Next
    Deterministic Trends Chow Tests Selection Criteria


    Methods to compare different forecasting models

    36