Docsity

Performing Regression Analysis in Excel: A Step-by-Step Guide, Study notes of Statistics

Toggle sidebar
bg1
Using๎˜ƒExcel๎˜ƒto๎˜ƒperform๎˜ƒregression๎˜ƒanalysis๎˜ƒ
This๎˜ƒset๎˜ƒof๎˜ƒnotes๎˜ƒis๎˜ƒjust๎˜ƒa๎˜ƒbasic๎˜ƒdescription๎˜ƒof๎˜ƒhow๎˜ƒto๎˜ƒuse๎˜ƒExcel๎˜ƒto๎˜ƒconduct๎˜ƒregression๎˜ƒanalysis.๎˜ƒ๎˜ƒIf๎˜ƒyou๎˜ƒ
already๎˜ƒknow๎˜ƒhow๎˜ƒto๎˜ƒuse๎˜ƒExcel๎˜ƒto๎˜ƒdo๎˜ƒthis,๎˜ƒthen๎˜ƒthat๎˜ƒis๎˜ƒfantastic.๎˜ƒ๎˜ƒIf๎˜ƒyou๎˜ƒhave๎˜ƒsome๎˜ƒother๎˜ƒprogram๎˜ƒthat๎˜ƒ
you๎˜ƒuse๎˜ƒfor๎˜ƒstatistical๎˜ƒanalysis๎˜ƒ(SAS,๎˜ƒStata,๎˜ƒEviews,๎˜ƒMatlab,๎˜ƒR,๎˜ƒetc.),๎˜ƒthat๎˜ƒis๎˜ƒfine๎˜ƒtoo๎˜ƒโ€“๎˜ƒthe๎˜ƒgreat๎˜ƒthing๎˜ƒ
about๎˜ƒregression๎˜ƒanalysis๎˜ƒis๎˜ƒthat๎˜ƒall๎˜ƒthe๎˜ƒprograms๎˜ƒgive๎˜ƒthe๎˜ƒsame๎˜ƒresults๎˜ƒbecause๎˜ƒregression๎˜ƒanalysis๎˜ƒ
basically๎˜ƒjust๎˜ƒinvolves๎˜ƒinverting๎˜ƒmatrices๎˜ƒand๎˜ƒmultiplying๎˜ƒthem๎˜ƒtogether๎˜ƒto๎˜ƒobtain๎˜ƒthe๎˜ƒcoefficient๎˜ƒ
estimates๎˜ƒ(other๎˜ƒtypes๎˜ƒof๎˜ƒeconometrics,๎˜ƒsuch๎˜ƒas๎˜ƒlimited๎˜ƒdependent๎˜ƒvariable๎˜ƒanalysis,๎˜ƒinvolve๎˜ƒ
convergence๎˜ƒbased๎˜ƒon๎˜ƒtolerance๎˜ƒlevels๎˜ƒwhich๎˜ƒcan๎˜ƒand๎˜ƒdo๎˜ƒdiffer๎˜ƒacross๎˜ƒprograms).๎˜ƒ
If๎˜ƒyou๎˜ƒhave๎˜ƒnot๎˜ƒused๎˜ƒExcel๎˜ƒfor๎˜ƒregression๎˜ƒanalysis,๎˜ƒand๎˜ƒyou๎˜ƒdo๎˜ƒnot๎˜ƒhave๎˜ƒother๎˜ƒstatistical๎˜ƒsoftware๎˜ƒto๎˜ƒuse,๎˜ƒ
then๎˜ƒread๎˜ƒbelow๎˜ƒ(or๎˜ƒread๎˜ƒthe๎˜ƒExcel๎˜ƒhelp๎˜ƒfile).๎˜ƒ๎˜ƒI๎˜ƒam๎˜ƒusing๎˜ƒthe๎˜ƒโ€œoldโ€fashionedโ€๎˜ƒmethod๎˜ƒโ€“๎˜ƒI๎˜ƒbelieve๎˜ƒsome๎˜ƒ
versions๎˜ƒof๎˜ƒExcel๎˜ƒhave๎˜ƒa๎˜ƒโ€œpoint๎˜ƒand๎˜ƒclickโ€๎˜ƒmethod๎˜ƒfor๎˜ƒregression๎˜ƒanalysis๎˜ƒwhich๎˜ƒI๎˜ƒdonโ€™t๎˜ƒhave๎˜ƒaccess๎˜ƒto๎˜ƒon๎˜ƒ
my๎˜ƒcomputers๎˜ƒ(then๎˜ƒagain,๎˜ƒI๎˜ƒdonโ€™t๎˜ƒuse๎˜ƒExcel๎˜ƒfor๎˜ƒestimating๎˜ƒmodels).๎˜ƒ
Instructions:๎˜ƒ
To๎˜ƒthe๎˜ƒbest๎˜ƒof๎˜ƒmy๎˜ƒknowledge,๎˜ƒmultiple๎˜ƒregression๎˜ƒanalysis๎˜ƒworks๎˜ƒbest๎˜ƒin๎˜ƒExcel๎˜ƒwhen๎˜ƒall๎˜ƒof๎˜ƒthe๎˜ƒdata๎˜ƒbeing๎˜ƒ
used๎˜ƒas๎˜ƒindependent๎˜ƒvariables๎˜ƒare๎˜ƒin๎˜ƒcolumns๎˜ƒthat๎˜ƒare๎˜ƒnext๎˜ƒto๎˜ƒeach๎˜ƒother๎˜ƒ(if๎˜ƒthere๎˜ƒwere๎˜ƒ5๎˜ƒindependent๎˜ƒ
variables,๎˜ƒthey๎˜ƒshould๎˜ƒbe๎˜ƒin๎˜ƒcolumns๎˜ƒC๎˜ƒโ€“๎˜ƒG).๎˜ƒ๎˜ƒThe๎˜ƒdependent๎˜ƒvariable๎˜ƒdoes๎˜ƒnot๎˜ƒhave๎˜ƒto๎˜ƒbe๎˜ƒin๎˜ƒa๎˜ƒcolumn๎˜ƒ
next๎˜ƒto๎˜ƒthe๎˜ƒindependent๎˜ƒvariables๎˜ƒ(it๎˜ƒcould๎˜ƒbe๎˜ƒin๎˜ƒcolumn๎˜ƒA๎˜ƒor๎˜ƒcolumn๎˜ƒK,๎˜ƒfor๎˜ƒinstance).๎˜ƒ๎˜ƒIf๎˜ƒyou๎˜ƒhave๎˜ƒyour๎˜ƒ
data๎˜ƒset๎˜ƒup๎˜ƒin๎˜ƒthe๎˜ƒpreceding๎˜ƒmanner,๎˜ƒthen๎˜ƒit๎˜ƒis๎˜ƒstraightforward๎˜ƒto๎˜ƒestimate๎˜ƒa๎˜ƒmultiple๎˜ƒregression๎˜ƒmodel๎˜ƒ
in๎˜ƒExcel.๎˜ƒ
1. Highlight๎˜ƒa๎˜ƒblock๎˜ƒof๎˜ƒcells๎˜ƒthat๎˜ƒis๎˜ƒ5๎˜ƒx๎˜ƒ(#๎˜ƒof๎˜ƒindependent๎˜ƒvariables๎˜ƒ+๎˜ƒconstant๎˜ƒterm).๎˜ƒ๎˜ƒSo๎˜ƒif๎˜ƒyou๎˜ƒhave๎˜ƒ
6๎˜ƒindependent๎˜ƒvariables,๎˜ƒthen๎˜ƒyou๎˜ƒwill๎˜ƒwant๎˜ƒto๎˜ƒhighlight๎˜ƒa๎˜ƒ5x7๎˜ƒblock๎˜ƒof๎˜ƒcells.๎˜ƒ
๎˜ƒ
2. Start๎˜ƒtyping๎˜ƒthe๎˜ƒmultiple๎˜ƒregression๎˜ƒcommand๎˜ƒfor๎˜ƒExcel.๎˜ƒ๎˜ƒIt๎˜ƒis๎˜ƒ=LINEST(Range๎˜ƒof๎˜ƒdependent๎˜ƒ
variable,๎˜ƒrange๎˜ƒof๎˜ƒindependent๎˜ƒvariables,๎˜ƒTRUE,๎˜ƒTRUE).๎˜ƒ๎˜ƒThe๎˜ƒcommand๎˜ƒโ€œLINESTโ€๎˜ƒis๎˜ƒfor๎˜ƒโ€œLinear๎˜ƒ
estimationโ€.๎˜ƒ๎˜ƒThe๎˜ƒrange๎˜ƒof๎˜ƒthe๎˜ƒdependent๎˜ƒvariable๎˜ƒshould๎˜ƒbe๎˜ƒin๎˜ƒa๎˜ƒsingle๎˜ƒcolumn๎˜ƒ(C2:C49).๎˜ƒ๎˜ƒThe๎˜ƒ
range๎˜ƒof๎˜ƒthe๎˜ƒindependent๎˜ƒvariables๎˜ƒshould๎˜ƒbe๎˜ƒin๎˜ƒthe๎˜ƒadjacent๎˜ƒcolumns,๎˜ƒand๎˜ƒmay๎˜ƒbe๎˜ƒsomething๎˜ƒ
like๎˜ƒ(D2:I49).๎˜ƒ๎˜ƒThe๎˜ƒfirst๎˜ƒโ€œTRUEโ€๎˜ƒvalue๎˜ƒis๎˜ƒfor๎˜ƒincluding๎˜ƒa๎˜ƒconstant,๎˜ƒand๎˜ƒthe๎˜ƒsecond๎˜ƒโ€œTRUEโ€๎˜ƒvalue๎˜ƒis๎˜ƒ
for๎˜ƒincluding๎˜ƒstatistics.๎˜ƒ๎˜ƒThus,๎˜ƒyour๎˜ƒentry๎˜ƒshould๎˜ƒlook๎˜ƒlike:๎˜ƒ
๎˜ƒ
=LINEST(C2:C49,D2:D49,TRUE,TRUE)๎˜ƒ
๎˜ƒ
Note๎˜ƒthat๎˜ƒas๎˜ƒyou๎˜ƒare๎˜ƒtyping๎˜ƒthis๎˜ƒcommand๎˜ƒthe๎˜ƒentry๎˜ƒwill๎˜ƒonly๎˜ƒappear๎˜ƒin๎˜ƒone๎˜ƒof๎˜ƒthe๎˜ƒcells.๎˜ƒ๎˜ƒBefore๎˜ƒ
โ€œunhighlightingโ€๎˜ƒthe๎˜ƒcells,๎˜ƒcontinue๎˜ƒto๎˜ƒstep๎˜ƒ3.๎˜ƒ
๎˜ƒ
3. The๎˜ƒLINEST๎˜ƒcommand๎˜ƒrequires๎˜ƒentry๎˜ƒas๎˜ƒan๎˜ƒarray.๎˜ƒ๎˜ƒWith๎˜ƒthe๎˜ƒcells๎˜ƒhighlighted,๎˜ƒpress๎˜ƒ
โ€œCtrl+Shift+Enterโ€.๎˜ƒ๎˜ƒI๎˜ƒwould๎˜ƒpress๎˜ƒโ€œCtrlโ€๎˜ƒfirst,๎˜ƒkeep๎˜ƒholding๎˜ƒit๎˜ƒdown,๎˜ƒthen๎˜ƒpress๎˜ƒโ€œShiftโ€,๎˜ƒand๎˜ƒkeep๎˜ƒ
holding๎˜ƒboth๎˜ƒbuttons๎˜ƒdown,๎˜ƒand๎˜ƒthen๎˜ƒpress๎˜ƒโ€œEnterโ€.๎˜ƒ๎˜ƒThe๎˜ƒkey๎˜ƒis๎˜ƒto๎˜ƒNOT๎˜ƒpress๎˜ƒโ€œEnterโ€๎˜ƒfirst๎˜ƒ
pf2

Partial preview of the text

Download Performing Regression Analysis in Excel: A Step-by-Step Guide and more Study notes Statistics in PDF only on Docsity!

Using Excel to perform regression analysis This set of notes is just a basic description of how to use Excel to conduct regression analysis. If you already know how to use Excel to do this, then that is fantastic. If you have some other program that you use for statistical analysis (SAS, Stata, Eviews, Matlab, R, etc.), that is fine too โ€“ the great thing about regression analysis is that all the programs give the same results because regression analysis basically just involves inverting matrices and multiplying them together to obtain the coefficient estimates (other types of econometrics, such as limited dependent variable analysis, involve convergence based on tolerance levels which can and do differ across programs). If you have not used Excel for regression analysis, and you do not have other statistical software to use, then read below (or read the Excel help file). I am using the โ€œoldโ€fashionedโ€ method โ€“ I believe some versions of Excel have a โ€œpoint and clickโ€ method for regression analysis which I donโ€™t have access to on my computers (then again, I donโ€™t use Excel for estimating models). Instructions: To the best of my knowledge, multiple regression analysis works best in Excel when all of the data being used as independent variables are in columns that are next to each other (if there were 5 independent variables, they should be in columns C โ€“ G). The dependent variable does not have to be in a column next to the independent variables (it could be in column A or column K, for instance). If you have your data set up in the preceding manner, then it is straightforward to estimate a multiple regression model in Excel.

  1. Highlight a block of cells that is 5 x (# of independent variables + constant term). So if you have 6 independent variables, then you will want to highlight a 5x7 block of cells.
  2. Start typing the multiple regression command for Excel. It is =LINEST(Range of dependent variable, range of independent variables, TRUE, TRUE). The command โ€œLINESTโ€ is for โ€œLinear estimationโ€. The range of the dependent variable should be in a single column (C2:C49). The range of the independent variables should be in the adjacent columns, and may be something like (D2:I49). The first โ€œTRUEโ€ value is for including a constant, and the second โ€œTRUEโ€ value is for including statistics. Thus, your entry should look like: =LINEST(C2:C49,D2:D49,TRUE,TRUE) Note that as you are typing this command the entry will only appear in one of the cells. Before โ€œunhighlightingโ€ the cells, continue to step 3.
  3. The LINEST command requires entry as an array. With the cells highlighted, press โ€œCtrl+Shift+Enterโ€. I would press โ€œCtrlโ€ first, keep holding it down, then press โ€œShiftโ€, and keep holding both buttons down, and then press โ€œEnterโ€. The key is to NOT press โ€œEnterโ€ first

(otherwise you wonโ€™t get the full results). Like magic, your highlighted block of cells should fill in with numbers.

  1. Iโ€™m going to reproduce the results from the Mrs. Smythโ€™s pie example here: 2815.494751 0.030258034 2.042729 29866.59 5.837648 โ€ 122607 529773. 4539.242557 0.0039448 3.762305 13449.22 1.650494 16422.38 271330. 0.871042264 67583.77555 #N/A #N/A #N/A #N/A #N/A 46.15560361 41 #N/A #N/A #N/A #N/A #N/A 1.26491E+12 1.8727E+11 #N/A #N/A #N/A #N/A #N/A What I find to be the most challenging aspect of Excelโ€™s estimation is remembering what variables the rows and columns correspond to. The first row will be coefficient estimates for your independent variables. The second row will be standard errors for those same variables. Note that these variables are in reverse order of how they appear in the spreadsheet. For instance, my independent variables ranged from D2:I49, so I had columns D, E, F, G, H, and I as independent variables, plus I included a constant. The columns D, E, F, G, H, and I correspond to the variables Price, Advertising Expenditures, Competitorโ€™s Price, Income, Population, and Time. The first column of results (with the coefficient estimate of 2815.49 and standard error of 4539.24) is for the LAST independent variable, Time. The second column is for Population, the third column for Income, etc. The very last column, with 529773.7 and 271330.9, contains the estimates for the intercept and its associated standard error. Note that none of the reported results are tโ€statistics, so that you will have to construct your own tโ€statistics. There are 6 other cells with numbers in them. I will reproduce those six cells and have a corresponding set of 6 cells that contain a description of the information provided. 0.871042264 67583.77555 R^2 SEE 46.15560361 41 Fโ€stat DF 1.26491E+12 1.8727E+11 RSS ESS SEE is the standard error of the estimate, Fโ€statistic is the Fโ€statistic for the joint significance of ALL the regressors, DF is the degrees of freedom, RSS is the regression sum of squares, and ESS is the error sum of squares.
  2. The process for producing the estimates is fairly straightforward, but I find it difficult to interpret the resulting output. Other statistical software produces much clearer output, so if you are familiar with other software I do not mind if you use it.