0% found this document useful (0 votes)
278 views

Using Excel For Principles-Of-Econometrics

Using excel for principles of econometrics

Uploaded by

Jack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
278 views

Using Excel For Principles-Of-Econometrics

Using excel for principles of econometrics

Uploaded by

Jack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Using Excel

For Principles
For Principles of Econometrics, Fourth Edition

i
Using Excel
For Principles
For Principles of Econometrics, Fourth Edition

GENEVIEVE BRIAND
Washington State University

R. CARTER HILL
 Louisiana State University

JOHN WILEY & SONS, INC


 New York / Chichester / Weinheim / Brisbane / Singapore / Toronto

ii
Genevieve Briand dedicates this work to Tom Trulove

Carter Hill dedicates this work to Todd and Peter

To order books o r for customer service call 1-800-CALL-WILEY (225-5945).

Copyright © 2011 John Wiley & Sons, Inc. All rights reserved.
reserved.

 No part o f this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
either the prior written permission of the Publisher, or authorization through payment of the
appropriate per-copy fee to the Copyright Clearance Center, Inc. 222 Rosewood Drive, Danvers,
MA 01923, (978)750-8400, fax (978)646-8600. Requests to the Publisher for permission should be
addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ
07030-5774, (201)748-6011, fax (201)748-6008.

ISBN 978-0-470-58581-8

iii
Preface

This book is a supplement to Principles of Econometrics, 4th Edition by R. Carter Hill, William E.


Griffiths and Guay C. Lim (Wiley, 2011). This book is not a substitute for the textbook, nor is it a
stand alone computer manual. It is a companion to the textbook, showing how to perform the
examples in the textbook using Excel 2007. This book will be useful to students taking
econometrics, as well as their instructors, and others who wish to use Excel for econometric
analysis.

In addition to this computer manual for Excel, there are similar manuals and support for the
software packages EViews, Gretl, Shazam, and Stata. In addition, all the data for  Principles of
 Econometrics, 4th in various formats, including Excel, are available at
http://www.wiley.com/college/hill. Individual data files, as well as errata for this manual and the
textbook, can also be found at http://principlesofeconometrics.com.

The chapters in this book parallel the chapters in  Principles of Econometrics, 4th. Thus, if you
seek help for the examples in Chapter 11 of the textbook, check Chapter 11 in this book.
However within a Chapter the sections numbers in  Principles of Econometrics, 4th do not
necessarily correspond to the Excel manual sections.

This work is a revision of Using Excel 2007 for Principles of Econometrics , 3rd   Edition by
Genevieve Briand and R. Carter Hill (Wiley, 2010). Genevieve Briand is the corresponding
author.

*
We welcome comments on this book, and suggestions for improvement.

Genevieve Briand
School of Economic Sciences
Washington State University
Pullman, WA 99164
 [email protected]

R. Carter Hill
Economics Department
Louisiana State University
Baton Rouge, LA 70803
[email protected]

*
 Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation. Our use does not directly or i ndirectly imply
Microsoft sponsorship, affiliation, or endorsement.

iv
BRIEF CONTENTS

1. Introduction to Excel 1
2. The Simple Linear Regression Model 19
3. Interval Estimation and Hypothesis Testing 67
4. Prediction, Goodness-of-Fit and Modeling Issues 95
5. The Multiple Linear Regression 143
6. Further Inference in the Multiple Regression Model 154
7. Using Indicator Variables 180
8. Heteroskedasticity 204
9. Regression with Time Series Data: Stationary Variables 228
10. Random Regressors and Moment-Based Estimation 262
11. Simultaneous Equations Models 278
12. Nonstationary Time-Series Data and Cointegration 294
13. Vector Error Correction and Vector Autoregressive Models 310
14. Time-Varying Volatility and ARCH Models 328
15. Panel Data Models 355
16. Qualitative and Limited Dependent Variable Models 391
A. Mathematical Tools 402
B. Review of Probability Concepts 416
C. Review of Statistical Inference 431
Index 466

v
CONTENTS 2.4.1 Model Assumptions 45
2.4.2 Random Number Generation
47
CHAPTER 1 Introduction to Excel 1
2.4.3 The LINEST Function 49
1.1 Starting Excel 1
2.4.4 Repeated Sampling 50
1.2 Entering Data 3
2.5 Variance and Covariance of b1 and b2
1.3 Using Excel for Calculations 3
52
1.3.1 Arithmetic Operations 3
2.6 Nonlinear Relationships 53
1.3.2 Mathematical Functions 4
2.6.1 A Quadratic Model 53
1.4 Editing your Data 6
2.6.1a Estimating the Model
1.5 Saving and Printing your Data 8
53
1.6 Importing Data into Excel 10
2.6.1b Scatter Plot of Data
1.6.1 Resources for Economists
with Fitted Quadratic
on the Internet 10
Relationship 55
1.6.2 Data Files for Principles of
2.6.2 A Log-Linear Model 57
Econometrics 13
2.6.2a Histograms of PRICE 
1.6.2a John Wiley & Sons
and ln( PRICE ) 57
Website 13
2.6.2b Estimating the Model
1.6.2b Principles of
61
Econometrics Website
2.6.2c Scatter Plot of Data
14
with Fitted Log-
1.6.3 Importing ASCII Files 14
Linear Relationship
62
CHAPTER 2 The Simple Linear Regression 2.7 Regression with Indicator Variables 63
Model 19 2.7.1 Histograms of House Prices
2.1 Plotting the Food Expenditure Data 19 63
2.1.1 Using Chart Tools 21 2.7.2 Estimating the Model 65
2.1.2 Editing the Graph 23
2.1.2a Editing the Vertical
CHAPTER 3 Interval Estimation and
Axis 23
Hypothesis Testing 67
2.1.2b Axis Titles 24
3.1 Interval Estimation 68
2.1.2c Gridlines and Markers
3.1.1 The t -Distribution 68
25
3.1.1a The t -Distribution
2.1.2d Moving the Chart
versus Normal
26
Distribution 68
2.2 Estimating a Simple Regression 27
3.1.1b t -Critical Values and
2.2.1 Using Least Squares
Interval Estimates
Estimators’ Formulas 27
69
2.2.2 Using Excel Regression
3.1.1c Percentile Values
Analysis Routine 31
69
2.3 Plotting a Simple Regression 34
3.1.1d TINV Function 69
2.3.1 Using Two Points 34
3.1.1e Appendix E: Table 2
2.3.2 Using Excel Built-in Feature
in POE 71
38
3.1.2 Obtaining Interval Estimates
2.3.3 Using a Regression Option
71
38
3.1.3 An Illustration 71
2.3.4 Editing the Chart 40
2.4 Expected Values of b1 and b2 44

vi
3.1.3a Using the Interval 3.4.1 The p-Value Rule 88
Estimator Formula 3.4.1a Definition of p-value
71 88
3.1.3b Excel Regression 3.4.1b Justification for the p-
Default Output 73 Value Rule 89
3.1.3c Excel Regression 3.4.2 The TDIST Function 91
Confidence Level 3.4.3 Examples of Hypothesis Tests
Option 74 Revisited 92
3.1.4 The Repeated Sampling 3.4.3a Right-Tail Test from
Context (Advanced Material) Section 3.3.1b 92
75 3.4.3b Left-Tail Test from
3.1.4a Model Assumptions Section 3.3.2 92
75 3.4.3c Two-Tail Test from
3.1.4b Repeated Random Section 3.3.3a 93
Sampling 75 3.4.3d Two-Tail Test from
3.1.4c The LINEST Function Section 3.3.3b 93
Revisited 77
3.1.4d The Simulation
CHAPTER 4 Prediction, Goodness-of-Fit
Template 78
and Modeling Issues 95
3.1.4e The IF Function 79
4.1 Least Squares Prediction 96
3.1.4f The OR Function 79
4.2 Measuring Goodness-of-Fit 98
3.1.4g The COUNTIF
4.2.1 Coefficient of Determination
Function 80 2
or R 98
3.2 Hypothesis Tests 81 2
4.2.2 Correlation Analysis and R
3.2.1 One-Tail Tests with
98
Alternative “Greater Than” (>)
4.2.3 The Food Expenditure
81
Example and the CORREL
3.2.2 One-Tail Tests with
Function 99
Alternative “Less Than” (<)
4.3 The Effects of Scaling the Data 100
82
4.3.1 Changing the Scale of x  100
3.2.3 Two-Tail Tests with
4.3.2 Changing the Scale of y  101
Alternative “Not Equal To” (≠)
4.3.3 Changing the Scale of x and y
82
102
3.3 Examples of Hypothesis Tests 82
4.4 A Linear-Log Food Expenditure Model
3.3.1 Right-Tail Tests 83
104
3.3.1a One-Tail Test of
4.4.1 Estimating the Model 104
Significance 84
4.4.2 Scatter Plot of Data with Fitted
3.3.1b One-Tail Test of an
Linear-Log Relationship 105
Economic Hypothesis
4.5 Using Diagnostic Residual Plots 108
84
4.5.1 Random Residual Pattern
3.3.2 Left-Tail Tests 84
108
3.3.3 Two-Tail Tests 86
4.5.2 Heteroskedastic Residual
3.3.3a Two-Tail Test of an
Pattern 111
Economic Hypothesis
4.5.3 Detecting Model Specification
87
Errors 112
3.3.3b Two-Tail Test of
4.6 Are the Regression Errors Normally
Significance 87
Distributed? 115
3.4 The p-Value 88

vii
10 Chapter 1

In the next section, we show you how to import data into an Excel spreadsheet. Getting data for
economic research is much easier today than it was years ago. Before the Internet, hours would be
spent in libraries, looking for and copying data by hand. Now we have access to rich data sources
which are a few clicks away.

First we will illustrate how convenient sites that make data available in Excel format can be. Then
we illustrate how to import ASCII or, text files, into Excel.

1.6 IMPORTING DATA INTO EXCEL

1.6.1 Resources for Economists on the Internet


Suppose you are interested in analyzing the GDP of the United States. The website Resources for
Economists contains a wide variety of data, and in particular the macro data we seek. Websites
are continually updated and improved. We guide you through an example, but be prepared for
differences from what we show here.

First, open up the website http://rfe.org/.

Select the Data link and then select U.S. Macro and Regional Data.
Introduction to Excel 11

This will open up a range of sub-data categories. For the example discussed here, select the
Bureau of Economic Analysis (BEA).
12 Chapter 1

Finally, select Gross Domestic Product (GDP).

The result shows the point we are making. Many government and other web sites make data
available in Excel format. Select Current-dollar and “real” GDP .

You have the option of saving the resulting Excel file to your computer or storage device, or
opening it right away — which we proceed to do next.

What opens is a workbook with headers explaining the variables it contained. We see that there is
a series of annual data and a quarterly series.
Introduction to Excel 13

The opened file is “Read Only” so you must save it under another name to work with it, graph,
run regressions and so on.

1.6.2 Data Files for Principles of Econometrics


The book Principles of Econometrics, 4e, uses many examples with data. These data files have
 been saved as workbooks and are available for you to download to your computer. There are
about 150 such files. The data files and other supplementary materials can be downloaded from
two web locations: the publisher website or the book website maintained by the authors.

1.6.2a John Wiley and Sons Website

Using your web browser, enter the address www.wiley.com/college/hill . Find, among the authors
named “Hill”, the book Principles of Econometrics, 4e.

Follow the link to Resources for Students, and then Student Companion Site. There, you will
find links to supplement materials, including a link to Data Files that will allow you to download
all the data definition files and data files at once.
14 Chapter 1

1.6.2b Principles of E conometri cs Website

The address for the book website is www.principlesofeconometrics.com .  There, you will find
links to the Data definitions files, Excel spreadsheets, as well as an Errata list. You can download
the data definition files and the Excel files all at once or select individual files. The data definition
files contain variable names, variable definitions, and summary statistics. The Excel spreadsheets
contain data only; those files were created using Excel 2003.

1.6.3 Importing ASCII Files


Sometimes data that you want to use may be provided but in ASCII or text format. To illustrate
go to http://principlesofeconometrics.com .  There you will find that one of the formats in which
we provide data is ASCII or text files. These are used because they contain no formatting and can
 be used by almost every software once imported.

Select ASCII files and then go to the food data.


Introduction to Excel 15

Right-click on the file name. Select Save Target As. A Save As dialog box pops up. Locate the
folder you want to save your file in by using the arrow-down located at the extreme right of the
Save in window or browsing through the list of folders displayed below it. Finally, select Save.

Once the download of the file is completed, a Download complete  window pops up. Choose
Close.

Start Excel. Select the  Office Button on the upper left corner of the Excel window , then Open.
Introduction to Excel 17

In the third and final step Excel permits you to format each column, or in fact to skip a column. In
our case you can simply select Finish.

This step concludes the process and now the data is in a worksheet named food.
18 Chapter 1

 Next, you need to save your food data in an Excel File format. To do that, select the Office
Button, Save As, and finally Excel Workbook .

A Save As  dialog box pops up. Locate the folder you want to save your file in by using the
arrow-down located at the extreme right of the Save in window or browsing through the list of
folders displayed below it.

Excel has automatically given a File name, food.xlsx, and specify the file format in the Save as
type window, Excel Workbook (*.xlsx). All you need to do is select Save.

From this point you are ready to analyze the data.

This completes our introductory Chapter. The rest of this manual is designed to supplement your
readings of Principles of Econometrics, 4e. We will walk you through the analysis of examples
found in the text, using Excel 2007. We would like to be able to replicate most of the plots of data
and tables of results found in your text.
CHAPTER 2
The Simple Linear Regression
Model

CHAPTER OUTLINE
2.1 Plotting the Food Expenditure Data 2.4.2 Random Number Generation
2.1.1 Using Chart Tools 2.4.3 The LINEST Function
2.1.2 Editing the Graph 2.4.4 Repeated Sampling
2.1.2a Editing the Vertical Axis
2.1.2b Axis Titles
2.5 Variance and Covariance of
2.6 Nonlinear Relationships
 
and

2.1.2c Gridlines and Markers 2.6.1 A Quadratic Model


2.1.2d Moving the Chart 2.6.1a Estimating the Model
2.2 Estimating a Simple Regression 2.6.1b Scatter Plot of Data with Fitted
2.2.1 Using Least Squares Estimators’ Formulas Quadratic Relationship
2.2.2 Using Excel Regression Analysis Routine 2.6.2 A Log-Linear Model
2.3 Plotting a Simple Regression 2.6.2a Histograms of PRICE  and
2.3.1 Using Two Points ln(PRICE )
2.3.2 Using Excel Built-in Feature 2.6.2b Estimating the Model
2.3.3 Using a Regression Option 2.6.2c Scatter Plot of Data with Fitted
2.3.4 Editing the Chart Log-Linear Relationship
2.4 Expected Values of  
2.4.1 Model Assumptions
and 2.7 Regression with Indicator Variables
2.7.1 Histograms of House Prices
2.7.2 Estimating the Model

In this chapter we estimate a simple linear regression model of weekly food expenditure. We also
illustrate the concept of unbiased estimation. In the first section, we start by plotting the food
expenditure data.

2.1 PLOTTING THE FOOD EXPENDITURE DATA

Open the Excel file food . Save it as POE Chapter 2.

Compare the values you have in your worksheet to the ones found in Table 2.1, p. 49 of
 Principles of Econometrics, 4e. The second part of Table 2.1 shows summary statistics. You can

19
20 Chapter 2

compute and check on those by using Excel mathematical functions introduced in Chapter 1, if
you would like.

Select the Insert  tab located next to the Home  tab. Select A2:B41. In the Charts  groups of
commands select Scatter, and then Scatter with only Markers .

The result is:

Each point on this Scatter chart illustrates one household for which we have recorded a pair of
values: weekly food expenditure and   weekly income. This is very important. We chose Scatter
chart  because we wanted to keep track of those pairs of values. For example, the point

highlighted below illustrates the pair of values 
 found in row  of your table.

When we select two columns of values to plot on a Scatter chart, Excel, by default, represents
values from the  first column on the horizontal axis   and values from the  second column on the
vertical axis . So, in this case, the expenditure values are illustrated on the horizontal axis and
income values on the vertical axis. Indeed, you can see that the scale of the values on the
48 Chapter 2

households with weekly income of  , so we specify the Number of Random Numbers to
 be 20. For simplicity we assumed that our population of households has weekly food expenditure
that is normally distributed, so this is the distribution we choose. Once you have selected Normal
in the Distribution window, you will be able to specify its Parameters: for  , its Mean is
|    and its Standard deviation is √ |  . Select the Output
Range in the Output options section, and specify it to be B2:B21 in your Simulation worksheet.
Finally, select OK .

Repeat to draw a random sample of


the Mean to |  
 from households with weekly income of
 and the Output Range to B22:B41.
 . Change

Here is the random sample that we obtained. NOTE: you will obtain a different   random sample,
due to the nature of random sampling.
The Simple Linear Regression Model 49

2.4.3 The LINEST Function


 Next, we use the LINEST  function to obtain the least squares estimates for the intercept and
slope parameters, based on the random sample we just drew. The LINEST  function is an
alternative to using the Least Squares Estimators’ Formulas (s ee Section 2.2.1) or the Excel
Regression Analysis Routine (see Section 2.2.2). It allows us to quickly get the least squares
estimates for the intercept and slope parameters. For this purpose, the general syntax of the
LINEST function is as follows:
= LINEST( y ’s, x ’s)

The first argument of the LINEST  function specifies the


 
values, and the second argument
specifies the   values, the least squares estimates are based on. In our case, we thus need to
specify:
= LINEST(B2:B41,A2:A41)

The LINEST function creates a table where it stores the least squares estimates in Excel memory.
It first reports the slope coefficient estimate, and then the intercept coefficient estimate. So, if we
were to look into Excel memory, the estimates would be reported as shown below:

column 1 column 2
row 1 b2 b1

We nest the LINEST function in the INDEX function to get the estimated coefficients, one at a
time. The INDEX function returns values from within a table. In the case of a table with only one
row, the INDEX function general syntax is as follows:

= INDEX(table of results, column_num)


50 Chapter 2

The first argument of the INDEX function specifies which table to get the results from. In our
case, this is the table of results generated by the LINEST function above. So, we replace “table of
results” by “LINEST(B2:B41,A2:A41)”. The second argument indicates from which column of
the table to retrieve the result of interest to us. So, if we want to retrieve the estimate of the

intercept coefficient, , from the table above, we would indicate that it can be found in column 2
 by replacing “column_num” by “ 2”.

We are going to report our estimated coefficients at the bottom of our table. In cell A43, type b1
=; in cell A44, type b2 =. Bold those labels. In cell B43 and B44, type the following equations,
respectively:
A B
43 b1= =INDEX(LINEST(B2:B41,A2:A41),2)
44 b2= =INDEX(LINEST(B2:B41,A2:A41),1)

Here are the estimates that we get:

The estimates of the intercept and slope coefficients are based on one  random sample. Our
random sample is different than yours, and each random sample yields different estimates, which
may or may not be close to the true parameter values. The property of unbiasedness is about the
average   values of  
  and if many  samples of the same size are drawn from the same
 population. In the next section, we are thus going to repeat our sampling and least squares
estimation exercise.

2.4.4 Repeated Sampling


 Note that in Chapter 2 of  Principles of Econometrics, 4e, the repeated samples given to you were
randomly collected from a population with unknown  parameters. In this section, we draw our
samples from a population with known parameters.

Go back to the Random Number Generation dialog box. We would like to draw  additional 
random samples, so we specify 9  in the Number of Variables  window. Again, we first draw
random samples of 
  from households with weekly income of 
, so we specify the
Number of Random Numbers  to be 20. We also select Normal in the Distribution window,
and specify its Parameters. For , its Mean is | 
 and its Standard Deviation
is √ |  . Specify the Output Range to be C2:K21. Finally, select OK .
The Simple Linear Regression Model 51

Repeat to draw a random sample of


the Mean to |  
 from households with weekly income of
 and the Output Range to C22:K41.
 . Change

 Next, before we copy the formula to get our coefficient estimates, we need to transform their
Relative cell references A2:A41 into Absolute cell references $A$2:$A$41, since we will be

using the same x-values for our next  rounds of least squares estimates.

Copy the formulas from B43:B44 into C43:K44. In cells L43:L44 compute the AVERAGEs of


your estimates from your  samples. In cell L43, you should have =AVERAGE(B43:K43); in
cell L44, you should have =AVERAGE(B44:K44). The estimates and average values that we get

for our  samples are:

If we took the averages of estimates from many samples, these averages would approach the true
    
 parameter values   and . To show you that this is the case, we repeated the exercise again.
 
Here are the average values of and  that we did get as we increased the number of samples
 
from , to 
, and finally to :

Number of samples 10 100 1000 Parameter Values


Average value of b1 89.14425 98.44593 99.48067 100
Average value of b2 10.48296 10.08958 10.04135 10
54 Chapter 2

In your br data worksheet, insert a column to the right of the sqft column B (see Section 1.4 for
more details on how to do
do that). In your new cells C1:C2, enter the following column label and
formula.
C
1 sqft2
2 =B2^2

Copy the content of cells C2 to cells C3:C1081. Here is how your table should look (only the
first five values are shown below):

In the Regression dialog box, the Input Y Range should be A2:A1081, and the Input X Range
should be C2:C1081. Select New Worksheet Ply and name it Quadratic Model. Finally select
OK .

The result is (matching the one reported on p. 70 in  Principles Econometrics, 4e):


 Principles of Econometrics
The Simple Linear Regression Model 55

 2.6.1b
 2.6.1b Scat
Scatter of
of Dat
Data and F itte
itted Quad
Quadratic
ratic R elat
lationsh
ionship
ip

Go back to your br data worksheet and select A2:B1081. Select the Insert tab located next to the
Home  tab. In the Charts  group of commands select Scatter, and then Scatter with only
Markers.

The result is:

You can see that our house price values are on the horizontal axis and square footage values are
on the vertical axis; we would like to change that around and edit our chart as we did in Section
2.1 with our plot of food expenditure data. The result is (see also Figure 2.14 on p. 70 in
Econometrics, 4e):
 Principles of Econometrics

Finally, we add the fitted quadratic relationship to our scatter plot. In cells N1:N2 and O1:O3 of
your br data worksheet , enter the following column label and formula.
56 Chapter 2

N O
1 quadratic price-hat sqft
2 ='Quadratic Model'!$B$17+'Quadratic
Model'!$B$17+'Quadratic Model'!$B$18*'br
Model'!$B$18*'br data'!O2 0
3 400

Select cells O2:O3, move your cursor to the lower right corner of your selection until it turns into
a skinny cross as shown below; left-click, hold it and drag it down to cell O22: Excel recognizes
the series and automatically completes it for you. Next, copy the content of cell N2  to cells
N3:N22. Here is how your table should look (only the first five values are shown below):

Go back to your scatter plot


plot and right-click in the middle
middle of your chart area. Select Select Data.
In the Legend Entries (Series) window of the Select Data Source dialog box, select the Add
 button. In the Series name window, type Fitted Quadratic Relationship . Select O2:O22 for the
Series X values   and select N2:N22 for the Series Y values. Finally, select OK . The Fitted
Quadratic Relationship series has been added to your graph.

Before you close the Select Data Source  dialog box, select Series1  and Edit. Type the name
Actual  in the Series name  window. Select OK . In the Select Data Source  window that re-
appears, select OK again.

Make sure you chart is selected so that the Chart Tools are visible. In the Layout tab, go to the
Labels  group of commands. Select the Legend  button and choose either one of the Overlay
The Simple Linear Regression Model 57

Legend options. Grab your legend with your cursor and move it to the upper left corner of your
chart area.

Finally, we want to reformat our Fitted Quadratic Relationship  values series. Select the plotted
series in your chart area, right-click and select Format Data Series. A Format Data Series
dialog box pops up. Select Line Color  and Solid line. Change the line color to something
different from the Actual series points. Select Marker Options, and change the Marker Type
from Automatic to None. Select Close.

The result is (see also Figure 2.14 on p. 70 in  Principles of Econometrics, 4e):

2.6.2 A Log-Linear Model

 2.6.2a H istograms of PRI CE and ln(PR I CE )

In your br data worksheet, insert a column to the right of the sqft2 column C (see Section 1.4 for
more details on how to do that). In your new cells D1:D2, enter the following column label and
formula.
58 Chapter 2

D
1 ln(price)
2 =ln(A2)

Copy the content of cells D2 to cells D3:D1081. Here is how your table should look (only the
first five values are shown below):

 Next, we specify BIN values. These values will determine the range of  
 and
values for each column of the histogram. The bin values have to be given in ascending order.
Starting with the lowest bin value, a  
 bin if it is equal to or less than the bin value.
 or  value will be counted in a particular

In cells S1:T3 of your br data worksheet , enter the following column labels and data.

S T
1 price bin lnprice bin
2 0 9
3 50000 9.2

Select cells S2:S3, move your cursor to the lower right corner of your selection until it turns into
a skinny cross as shown below; left-click, hold it and drag it down to cell S34: Excel recognizes
the series and automatically completes it for you. Similarly, select cells T2:T3, move your cursor
to the lower right corner of your selection until it turns into a skinny cross; left-click, hold it and
drag it down to cell T29. Here is how your table should look (only the first five values are shown
 below):

Select the Data tab, in the middle of your tab list. On the Analysis group of commands to the far
right of the ribbon, select  Data Analysis .

The Data Analysis  dialog box pops up. In it, select Histogram (you might need to use the scroll
up and down bar to the right of the Analysis Tools  window to find it), then select OK .
The Simple Linear Regression Model 59

An Histogram dialog box pops up. For the Input Range, specify A2:A1081; for the Bin Range,
specify S2:S34. The Input Range  indicates the data set Excel will look at to determine how
many values are counted in each bin of the Bin Range. Check the New Worksheet Ply  option
and name it Price Histogram; check the box next to Chart Output. Finally, select OK .

Select the columns in your chart area, right-click and select Format Data Series. The Series
Options tab of the Format Data Series dialog box should be open. Select the Gap Width button
and move it to the far left, towards No Gap.

Go to the Border Color  tab and select Solid line, choose a different Color if you would like.
Select Close.
60 Chapter 2

After editing our chart as we did in Section 2.1 with our plot of food expenditure data, the result
is (see also Figure 2.16(a) on p. 72 in  Principles of Econometrics, 4e):

 Note that the frequencies given in the graph above are absolute ones, while the frequencies given
in Figure 2.16(a) of Principles of Econometrics, 4e are relative ones.

Go back to your br data  worksheet. In the Histogram dialog box , specify D2:D1081 for the
Input Range and T2:T29 for the Bin Range. Check the New Worksheet Ply option and name it
lnPrice Histogram; check the box next to Chart Output. Finally, select OK .

The final result is (see also Figure 2.16(b) on p. 72 in  Principles of Econometrics, 4e):
We hope you’ve enjoyed this complimentary
preview of Using Excel for Principles of
Econometrics by Genevieve Briand. To
continue reading, please purchase the full
manual:

Format: Paperback
ISBN: 978-1-118-03210-7

http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118032101.html

Additional eText formats are available at www.amazon.com .

You might also like