econ 321 midterm prep

Upload: bobby-mylan

Post on 14-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 ECON 321 Midterm Prep

    1/59

    ECON 321 Midterm

  • 7/27/2019 ECON 321 Midterm Prep

    2/59

    Summation Operator

    xi= x1+ x2+ + xn

    For any constant c, c = nc

    For any constants a and b, (axi+

    byi )=

    a xi+

    b yii=1

    n

    i=1

    n

    i=1

    n

  • 7/27/2019 ECON 321 Midterm Prep

    3/59

    Statistics

    If x~N(, 2), then

    Expectation:

    If c is a constant, then E(c) = c

    If {a1, a2, , an} are constants and {x1, x2, , xn}

    are random variables, then

    z= x ms ~N(0,1)

    E(a1x1+a2x2+...+anxn)= a1E(x1)+a2E(x2)+...+anE(xn)

  • 7/27/2019 ECON 321 Midterm Prep

    4/59

    Statistics (Continued)

    Variance and Covariance:

    If c is a constant, then Var(c) = 0

    Cov(x,y) =E[(x m x )(y m y )]=E{[x E(x)][y E(y)]}

    =E(xy) E(x)E(y)

    =E[(x m x )y]=E[x(y m y )]

  • 7/27/2019 ECON 321 Midterm Prep

    5/59

    Statistics (Continued)

    If x and y are independent, then Cov(x,y) = 0

    because E(xy) = E(x)E(y) when they are

    independent

    However, zero covariance between x and y

    does not necessarily imply that x and y are

    independent

  • 7/27/2019 ECON 321 Midterm Prep

    6/59

    Statistics (Continued)

    Try the following. If you can prove this, then

    you are all set for properties of expectation,

    variance, and covariance!

    Var(ax+by)=a2Var(x)+b2Var(y)+2abCov(x,y)

  • 7/27/2019 ECON 321 Midterm Prep

    7/59

    Statistics (Continued)

    Correlation coefficient:

    If x and y are independent, then x,y= 0, but zero

    correlation itself does not necessarily imply

    independence

    r [ 1,1]

  • 7/27/2019 ECON 321 Midterm Prep

    8/59

    Ordinary Least Squares

    Least squares refers to the minimizing the sum

    of squared residuals

    Trivia: why not

    Cannot be minimized because solution can be

    either positive or negative

    min ui2

    i=1

    n

    min uii=1

    n

    ?

  • 7/27/2019 ECON 321 Midterm Prep

    9/59

    Ordinary Least Squares (Continued)

    Estimators:

    First order conditions or method of moments

    Hint: the point is always on the OLS

    regression line (SRF line)

    (x,y)

    y= 0+ 1x 0=y 1x

  • 7/27/2019 ECON 321 Midterm Prep

    10/59

    Statistical Properties of OLS

    An estimator is unbiasedif its expected value

    (or mean of its sampling distribution) equals

    the population value

    S i i l P i f OLS

  • 7/27/2019 ECON 321 Midterm Prep

    11/59

    Statistical Properties of OLS

    (Continued)

    Gauss-Markov assumptions:

    iidindependently (i.e., each random variable is

    mutually independent of every other random variable)

    and identically distributed (i.e., each random variable

    has the same probability distribution as every other

    random variable)

    ui ~iid(0,s u2 )E(u |x) =E(u)

    = 0

    S i i l P i f OLS

  • 7/27/2019 ECON 321 Midterm Prep

    12/59

    Statistical Properties of OLS

    (Continued)

    E(u|x) = E(u) = 0 is also referred to as the zeroconditional mean assumption; the expectationof u is zero given any values of x

    Cov(ui, uj) = 0 for all i != j; also referred to asno serial correlation (if you choose to go on totime series, especially financial econometrics)

    for all i = 1, 2, , n Also referred to as the constant

    variance/homoskedasticity assumption

    Var(ui )=s

    u

    2

  • 7/27/2019 ECON 321 Midterm Prep

    13/59

    Unbiasedness of 1

    1= (xi x )yi

    i=1

    n

    (xi x )2

    i=1

    n

    E( 1) =E(xi x )yi

    i=1

    n

    (xi x )2

    i=1

    n

    =E

    (xi x )( 0+i=1

    n

    1xi+ui )

    (xi x )2

    i=1

    n

  • 7/27/2019 ECON 321 Midterm Prep

    14/59

    Unbiasedness of 1(Continued)

    =E 0 (xi x )+

    i=1

    n

    1 xi (xi x )+i=1

    n

    ui (xi x )i=1

    n

    (xi x )2

    i=1

    n

    =E 1+ui (xi x )

    i=1

    n

    (xi x )2

    i=1

    n

    =E( 1)+Eui (xi x )

    i=1

    n

    (xi x )2

    i=1

    n

  • 7/27/2019 ECON 321 Midterm Prep

    15/59

    Unbiasedness of 1(Continued)

    = 1 +E[ui (xi x )

    i=1

    n

    ]

    (xi x )2

    i=1

    n

    = 1

    The numerator is essentially

    Cov(x,u) (E(u) = 0), which is

    assumed to be zero per the

    zero conditional mean

    assumption (E(u|x) = E(u) =

    0)

  • 7/27/2019 ECON 321 Midterm Prep

    16/59

    Unbiasedness of 0

    0=y 1x

    = 0+ 1x+u 1x= 0+ ( 1 1)x+uE( 0 ) =E[ 0+ ( 1 1)x+u]=E( 0 )+E[( 1 1)x ]+E(u)= 0+E[( 1 1)x ]=

    0

    If 1isunbiased, then

    the second

    term is equal tozero

  • 7/27/2019 ECON 321 Midterm Prep

    17/59

    Gauss-Markov Theorem

    Under the Gauss-Markov assumptions, the OLSestimator(s) is/are the BLUE(s)

    Best

    Linear*Unbiased*

    Estimator

    The theorem only applies to comparisonsbetween unbiased estimators

  • 7/27/2019 ECON 321 Midterm Prep

    18/59

    Measures of Goodness of Fit

    Total sum of squares (SST/TSS):

    Total sample variation (spread) in thedependent variable about its sample average

    Explained sum of squares (SSE/ESS):

    Total sample variation of the fitted values in a(multiple) regression model

    (yi y )2

    i=1

    n

    (

    yi )

    ( yi y)2

    i=1

    n

    M f G d f Fit

  • 7/27/2019 ECON 321 Midterm Prep

    19/59

    Measures of Goodness of Fit(Continued)

    Sum of squared residuals/residual sum of

    squares (SSR):

    The sum of the squared OLS residuals across all

    observations; variation of residuals in the sample

    In my own words, goal of least squaresminimize unobserved SSR to maximize the

    explanatory power of the independent variable(s)

    ui2

    i=1

    n

    M f G d f Fit

  • 7/27/2019 ECON 321 Midterm Prep

    20/59

    Measures of Goodness of Fit(Continued)

    SST = SSE + SSR

    Coefficient of determination (R-squared):

    The proportion of the total sample variation in the

    dependent variable that is explained by the

    independent variable(s)

    R2 =

    SSE

    SST

    =1SSR

    SST

    M f G d f Fit

  • 7/27/2019 ECON 321 Midterm Prep

    21/59

    Measures of Goodness of Fit(Continued)

    100*R2is the percentage of the sample variationin the dependent variable that is explained by theindependent variable(s)

    Note that R-squared only measures the linearrelationship between dependent andindependent variables

    R2can be easily inflated by increasing the size of

    the sample (and the number of independentvariables [other issues will also arise, as you willsee later in the course (?)])

  • 7/27/2019 ECON 321 Midterm Prep

    22/59

    Units of Measurement

    Change in the unit of measurement of theindependent variable:

    Now, lets change x for , where the latter is x/10,then

    Previously, for every increase in x, the fitted valueincreases by 1.5

    Now, for every increase in , the fitted value increasesby 15, but each independent variable has beenchanged to be 1/10 of their original value, so therelationship remains the same

    yi= 2+1.5xi

    xiyi= 2+15xi

    xi

  • 7/27/2019 ECON 321 Midterm Prep

    23/59

    Units of Measurement (Continued)

    This can be proved very simply (your professorpresented a more formal proof, but this is forintuition):

    The converse is also true (i.e., change x to ,valued at 10xdivide by 10)

    yi= 2+15xi

    = 2+10(1.5)(xi

    10)

    = 2+1.5xi

    xi 1

  • 7/27/2019 ECON 321 Midterm Prep

    24/59

    Units of Measurement (Continued)

    Change in the unit of measurement of the

    dependent variable:

    Now, lets change to , where the latter is 1/10

    the value, then

    Do we still have the same relationship? Of course!

    The converse applies also in this case

    yi= 2+1.5xi

    yi yi

    yi= 0.2+0.15xi

  • 7/27/2019 ECON 321 Midterm Prep

    25/59

    Units of Measurement (Continued)

    Change in unit of measurement in both

    variables:

    Now, we will combine the two changes ( and )

    yi= 2+1.5xi

    xi yiyi

    10=

    2

    10+10

    1

    10

    (1.5)

    xi

    10

    yi=0.2+10 110

    (1.5)xi

    yi=0.2+1.5xi

  • 7/27/2019 ECON 321 Midterm Prep

    26/59

    Statistical Inference

    Terms:

    Null hypothesisone takes this hypothesis as

    true and requires the data to provide substantial

    evidence that suggests otherwise H0

    Alternative hypothesishypothesis against

    which the null hypothesis is tested

    H1/Ha

  • 7/27/2019 ECON 321 Midterm Prep

    27/59

    Statistical Inference (Continued)

    Never accept the null hypothesisonly do

    not reject

    Type I errorrejection of H0when it is true

    Type II errorfailure to reject H0when it is

    false

    Significance levelprobability of type I error in

    hypothesis testing

    alpha

  • 7/27/2019 ECON 321 Midterm Prep

    28/59

    Statistical Inference (Continued)

    One-sided alternative one-sided test

    H0: < 0,H1: > 0

    H0: > 0, H1: < 0

    Two-sided alternative two-sided test

    H0: = 0,H1: != 0

  • 7/27/2019 ECON 321 Midterm Prep

    29/59

    Statistical Inference (Continued)

    t-statistic for 0and 1:

    Why n2?

    Degree of freedom (df)

    # of observations# of estimated parameters (i.e.,estimators)

    Decreases as you add more independent variables (later in thecourse) (i.e., intercept + 2 independent variablesn3)

    t= 0 0

    se( 0 ) ~tn 2t=

    1 1se( 1) ~tn 2

  • 7/27/2019 ECON 321 Midterm Prep

    30/59

    Statistical Inference (Continued)

    Side note:

    Var( 0

    )=

    s u2n 1 xi2i=1

    n

    (xi x )2

    i=1

    n

  • 7/27/2019 ECON 321 Midterm Prep

    31/59

    Statistical Inference (Continued)

    Hypothesis testing:

    Lets work with an example (random data

    generated in R)

  • 7/27/2019 ECON 321 Midterm Prep

    32/59

    Statistical Inference (Continued)

    Suppose that I want to test if 1is equal to-

    0.37

    Two-sided test

    H0: 1= -0.37, H1: 1!= -0.37

    t= 0.3671 ( 0.37)

    0.1941

    ~t98

    = 0.014940752

  • 7/27/2019 ECON 321 Midterm Prep

    33/59

    Statistical Inference (Continued)

    Critical valuethe value against which a test

    statistic is compared to determined whether

    to reject H0or not

    One-sided testt > c or t < c, where c is the

    critical value

    Two-sided test|t|> c

  • 7/27/2019 ECON 321 Midterm Prep

    34/59

    Statistical Inference (Continued)

    How to find the critical value?

    Determine your significance level (from earlier)

    One-sided test

    Two-sided test/2 Because you want 100*(1)% confidencethat you are not

    wrongly rejecting H0middle region

    Since this is a t-test, we will go to the t-table

  • 7/27/2019 ECON 321 Midterm Prep

    35/59

    Statistical Inference (Continued)

    Our df is 98 (100

    observations2

    estimators), so 100is the closest

    approximation on

    this table

  • 7/27/2019 ECON 321 Midterm Prep

    36/59

    Statistical Inference (Continued)

    Our df is 98 (100

    observations2

    estimators), so 100is the closest

    approximation on

    this table

    Now, assume that

    I want a

    significance level

    of 5% ( = 0.05).

    However, this is a

    two-sided test, so

    I need /2 =0.025 for my tail

    probability.

    ( )

  • 7/27/2019 ECON 321 Midterm Prep

    37/59

    Statistical Inference (Continued)

    Our df is 98 (100

    observations2

    estimators), so 100is the closest

    approximation on

    this table

    Now, assume that

    I want a

    significance level

    of 95%, = 0.05.

    However, this is a

    two-sided test, so

    I need /2 =0.025 for my tail

    probability.

    l f ( d)

  • 7/27/2019 ECON 321 Midterm Prep

    38/59

    Statistical Inference (Continued)

    So my critical value is 1.984 per the table

    Rejection rule: |t| > c|t| > 1.984

    If this is true, you reject H0

    Since my test statistic was 0.014940752, which isless than 1.984, I do not reject H0

    Conclusionwith 95% confidence, I do not reject

    the hypothesis that 1is equal to -0.37

    l f ( d)

  • 7/27/2019 ECON 321 Midterm Prep

    39/59

    Statistical Inference (Continued)

    Caveat:

    I do not know what kind of t-table you will use on

    the midterm, so pay attention to the headings

    Some tables have tail probabilities for both one- andtwo-sided tests

    S i i l f (C i d)

  • 7/27/2019 ECON 321 Midterm Prep

    40/59

    Statistical Inference (Continued)

    What if you were given 2(i.e., it is known)?

    Use the standard normal table

    Back to our example

    As you can see, the test statistic is now distributed

    N(0,1)standard normal

    t= 0.3671 ( 0.37)

    0.1941~N(0,1)

    = 0.014940752

    S i i l I f (C i d)

  • 7/27/2019 ECON 321 Midterm Prep

    41/59

    Statistical Inference (Continued)

    Same significance level

    95% two-sidedyou are now looking for 0.975 (1

    /2) in the standard normal table

    The value is 1.96

    Standard normal critical values are easy to remember

    0.9952.575

    0.992.33

    0.9751.96

    0.951.645

    0.91.28

    S i i l I f (C i d)

  • 7/27/2019 ECON 321 Midterm Prep

    42/59

    Statistical Inference (Continued)

    Rejection rule: |t| > c|t| > 1.96

    Again, this is not the case, so H0is not rejected

    S i i l I f (C i d)

  • 7/27/2019 ECON 321 Midterm Prep

    43/59

    Statistical Inference (Continued)

    Overview: Identify the hypothesis test (one-/two-sided)

    Determine the significance level (if not specified, isusually left as = 0.05)

    Calculate the test statistic Determine the distribution of the test statistic (for OLS

    estimators, is usually t distribution)

    Find the critical value corresponding to the specified

    significance level Determine the rejection rule

    Compare test statistic with critical value Either reject or do not rejectH0

    St ti ti l I f (C ti d)

  • 7/27/2019 ECON 321 Midterm Prep

    44/59

    Statistical Inference (Continued)

    p-value!

    I believe this one confuses some people

    Smallest significance level at which H0can be

    rejected Or, the largest significance level at which H0cannot be

    rejected

    St ti ti l I f (C ti d)

  • 7/27/2019 ECON 321 Midterm Prep

    45/59

    Statistical Inference (Continued)

    What does this mean?

    For example, if you are comfortable with a 95%significance level (i.e., 5% chance that you rejectH

    0when it should have been otherwise), but the

    smallest significance level that the particular teststatistic can be rejected at is lower than 5%, itmeans the statistic is even more assuring thanwhat you initially set, so you can go ahead andreject H0knowing that the chance of wrongingdoing so is smaller than what you are comfortablewith (it sounds weird, but it is a good thing)

    St ti ti l I f (C ti d)

  • 7/27/2019 ECON 321 Midterm Prep

    46/59

    Statistical Inference (Continued)

    How to calculate the p-value:

    Back to our example:

    Need to scour the standard normal table for

    0.014940752, or something close to it.

    t=

    0.3671 ( 0.37)

    0.1941 ~N(0,1)

    = 0.014940752

    St ti ti l I f (C ti d)

  • 7/27/2019 ECON 321 Midterm Prep

    47/59

    Statistical Inference (Continued)

    The value is somewhere between 0.5040 and0.50800.5060 is my guess

    St ti ti l I f (C ti d)

  • 7/27/2019 ECON 321 Midterm Prep

    48/59

    Statistical Inference (Continued)

    Since this is a two-sided test, we need to

    calculate

    If the rejection rule is t > c, then you need to

    calculate P(T > t), or P(T < t)

    See previous STAT courses or Wooldridge for areferesher

    P(|T|>| t|)= 2P(T>| t|)

    = 2[1 P(T

  • 7/27/2019 ECON 321 Midterm Prep

    49/59

    Statistical Inference (Continued)

    Conclusion0.988 > = 0.05do not rejectH0; it should be the same as the t-test

    P(|T|>| t|) = 2P(T>| t|)

    = 2[1 P(T

  • 7/27/2019 ECON 321 Midterm Prep

    50/59

    Statistical Inference (Continued)

    Simple rule:

    Reject p-values smaller than

    Statistical Inference (Contin ed)

  • 7/27/2019 ECON 321 Midterm Prep

    51/59

    Statistical Inference (Continued)

    Confidence interval:

    A rule used to construct a random interval so that

    a certain percentage of all data sets, determined

    by the confidence level, yields an interval thatcontains the population value

    In other words, if we construct confidence

    intervals for a certain parameter out of a certain

    number of samples, these intervals will contain its

    population value 100*(1)% of the time

    Statistical Inference (Continued)

  • 7/27/2019 ECON 321 Midterm Prep

    52/59

    Statistical Inference (Continued)

    Back to our example:

    Earlier, we found the critical value for /2 = 0.025,which was 1.984

    Note: confidence intervals are always considered to be

    two-sided We have all the information we need to construct the

    confidence interval

    t= 0.3671 ( 0.37)

    0.1941~t98

    = 0.014940752

    Statistical Inference (Continued)

  • 7/27/2019 ECON 321 Midterm Prep

    53/59

    Statistical Inference (Continued)

    That above is the 95% confidence interval for

    1

    CI= [ 1 c2

    se( 1), 1+ c2

    se( 1)]= [ 0.3671 1.984(0.1941), 0.3671+1.984(0.1941)]

    = [ 0.3671 0.3850944, 0.3671+0.3850944]

    = [ 0.7521944,0.0179944]

    STATA!

  • 7/27/2019 ECON 321 Midterm Prep

    54/59

    STATA!

    Disclaimer: pure R user, never used STATA

    However, I am able to read the outputs and have

    constructed questions around them

    STATA Output

  • 7/27/2019 ECON 321 Midterm Prep

    55/59

    STATA Output

    STATA Output

  • 7/27/2019 ECON 321 Midterm Prep

    56/59

    STATA Output

    SSE/ESS SSR/RSS SST/TSS any two can be used to solve for R-squared

    STATA Output

  • 7/27/2019 ECON 321 Midterm Prep

    57/59

    STATA Output

    0 1 se( i ),i= 0,1

    STATA Output

  • 7/27/2019 ECON 321 Midterm Prep

    58/59

    STATA Output

    t= i

    se( i ), i= 0,1Significance test (H0: i= 0)

    STATA Output

  • 7/27/2019 ECON 321 Midterm Prep

    59/59

    STATA Output

    p-value of significance test