bestclassxiiiandxiv[1]

Embed Size (px)

Citation preview

  • 7/29/2019 bestclassxiiiandxiv[1]

    1/14

    Business Econometrics using SAS

    Tools (BEST)

    Class XIII and XIV Regression and

    Review

  • 7/29/2019 bestclassxiiiandxiv[1]

    2/14

    Home Price and Size Data

    Sizein 000 SF;

    Pricein 000 USD

    Cross Section data for 59 cities across the US Question does price depend on size?

    If yes, can we predict how?

  • 7/29/2019 bestclassxiiiandxiv[1]

    3/14

    Import the Data

    PROCIMPORT DATAFILE =

    'c:\sasdata\sizeprice.xls' DBMS=EXCEL OUT =

    homeprice replace;

    RUN;

    PROCPRINT DATA = homeprice;

    TITLE 'Home Prices'; RUN;

  • 7/29/2019 bestclassxiiiandxiv[1]

    4/14

    Plot

    Graph the variables

    1st step is there a linear relationship?

    If not, OLS regression is not useful Remember that is why, print the data if

    small or Summarize the data if large

    Get a feel of the data set before crunching thenumbers

  • 7/29/2019 bestclassxiiiandxiv[1]

    5/14

    SAS Scatter Plot

    PROCGPLOT DATA=homeprice;

    PLOT Price*Size;

    RUN;

  • 7/29/2019 bestclassxiiiandxiv[1]

    6/14

    Relation

    A clear linear relation is observed

    Ocular Estimation gives the go ahead

    We know we can run a regression Use PROC REG

  • 7/29/2019 bestclassxiiiandxiv[1]

    7/14

    Regression and Plot

    PROCREG DATA=HomePrice;

    MODEL Price=Size / clb;

    PLOT Price*Size='+' p.*Size='*' / overlay; OUTPUT OUT=NEW P=PRED;

    RUN;

  • 7/29/2019 bestclassxiiiandxiv[1]

    8/14

    Plot with Regression Line

  • 7/29/2019 bestclassxiiiandxiv[1]

    9/14

    ANOVA

    Analysis of Variance

    Source DF

    Sum of

    Squares

    Mean

    Square F Value Pr > F

    Model 1 71534 71534 184.62

  • 7/29/2019 bestclassxiiiandxiv[1]

    10/14

    Regression Estimates

    Parameter Estimates

    Variable Label

    D

    F

    Parameter

    Estimate

    Standar

    d

    Error t Value Pr > |t|

    95% Confidence

    Limits

    Intercept Intercept 1 5.43157 8.19061 0.66 0.5100

    -

    10.9761

    9

    21.8393

    3

    Size Size 1 56.08328 4.12758 13.59

  • 7/29/2019 bestclassxiiiandxiv[1]

    11/14

    Inferences and Prediction

    We want to

    estimate the mean selling price for houses of size

    1750 sq. feet

    predict the selling price of a new house of size

    1750 sq. feet.

  • 7/29/2019 bestclassxiiiandxiv[1]

    12/14

    Prediction

    DATA Xvalue;

    INPUT size price;

    CARDS;

    1.750.;

    DATA homeprice;

    SET homeprice Xvalue;

    PROCREG DATA=homeprice;

    MODEL Price=Size / clm cli;

    RUN;

  • 7/29/2019 bestclassxiiiandxiv[1]

    13/14

    New Statements

    The options clm and cli will give us ConfidenceIntervals for the mean of Y, for the values of X(the sizes) in the data set.

    The CARDS statement lets you quickly appendadditional lines of data and should be used if youare adding a small amount of data internal toyour program

    In case we had to get the same details(predictions) for a large dataset we would haveused the INPUT or IMPORT command

  • 7/29/2019 bestclassxiiiandxiv[1]

    14/14

    Review

    In the 2nd half of the class we will review the

    entire semester

    If there are any questions please let me

    know.

    If not, I will walk you through the salient

    points of the course so that you get no

    surprises on this material in the future.