Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Linear Regression Analysis: Least Squares Principle

Options
  • 23-11-2009 9:28pm
    #1
    Closed Accounts Posts: 62 ✭✭


    Hello all!

    I'm currently studying econometrics, and I was wondering if anybody could furnish me with an economic application/example (with figures, not just the formula) of the least squares principle in relation to linear regression analysis?
    Secondly, If somebody could provide a step-by-step guide on how to do the above on excel also, that'd be great too!

    Thanks in advance!;)


Comments

  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    1) Just collect some data from a reliable source. Penn World Tables is an easy one to use.

    2) Well, this should be evident from any undergrad textbook, really. Just get some observations for a y-variable and an x-variable. Then simply use the formula in your textbook to input commands in your cells in order to produce beta1, beta0 and the residual sum of squares.

    This book is a very simple outline of regression analysis, complete with easy to follow examples:

    http://wps.aw.com/aw_studenmund_useecon_5/

    Check if your library has it.


  • Registered Users Posts: 871 ✭✭✭gerry87


    An example is imagine the relationship between the price of a car and the age of a car. Collect data of car prices and ages of those cars, then run a regression. You're trying to be able to predict the price of the car for any age you want.

    Run your regression and you'll get a few numbers, an intercept and a beta are the two you need for now. Say for example the intercept for the cars is 10,000 and the beta is -1,200.

    The regression you ran was as follows:
    Y = alpha + beta*X
    Y = price of a car
    X = age of a car (in years)
    alpha = intercept (basically the value of Y when X is zero, so for a new car)
    beta = the change in price for a given change in years

    So in our example the regression was:
    Y = 10,000 - 1,200*X

    so for a 1 year old car, we expect the price to be roughly.
    Y = 10,000 - 1,200*1 = 8,800
    for a 2 year car,
    Y = 10,000 - 1,200*2 = 7,600

    and so on.

    There's a few ways to do it in excel, one easy way is to do a scatter plot of your two variables, right click one of the datapoints and click add trendline, go to options and click show coefficient. The line on the plot is the plot of your regression equation (Y = 10,000 - 1,200*X), it's the line that minimises the average distance between the line and all the data points.

    You can do it yourself using the formula Beta = Covariance(Y,X)/Var(X), then Intercept = Average(Y) - Beta*Average(X), that'll get you your equation.

    Hope that explains it, play around with it, its the only way to learn it really.

    edit: whoops


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    That should be var(X) for the beta coefficient.


  • Closed Accounts Posts: 62 ✭✭patriks


    Thanks a million, everybody!;)
    Those replies were really helpful.
    It's really appreciated.


Advertisement