This page describes how to obtain the data files for the book Regression Analysis By Example by Samprit Chatterjee, Ali S. Hadi & Bertram Price.
There are basically three ways that you can download the data files uesd
on these web pages.
1. Downloading all of the files in Stata,
2. Using individual files from Stata, or
3. Getting the files via this web page.
These three methods are described below.
1. Downloading All of the Files in Stata
If you want to download all of the files, we suggest you create a new directory, such as c:chp , and copy the files there. If you wanted to make and use this directory, you would type the following in the Stata command window…
mkdir c:chp cd c:chp
To copy all of the files, type
net from https://stats.idre.ucla.edu/stat/stata/examples/ net get chp
2. Using Individual Files from Stata
If you prefer, you can simply use any of the files individually over the internet. The names of the data files are shown in the table below based on the first page the data file appears.. Suppose you wanted to use the p004 data file. You would type
use https://stats.idre.ucla.edu/stat/stata/examples/chp/p004
3. Getting Files Over the Web
If you prefer, you can get the files over the web from the table shown below. The leftmost column gives you the description of the data file, followed by the Stata data file and the raw data file. The data sets are ordered by chapter number and page number within each chapter. The name of each file is Pxxx.dta (for the Stata data files) or Pxxx.txt (for the raw data files), where Pxxx is the page number xxx in the book where the data are given.
You can click on the "Stata .dta File" and it will download the Stata .dta File. If you have Stata installed on your computer, and you choose "Open the File" it should read the file right into Stata. You can click on the raw data file to see what the raw data looks like.
The raw data files are all in text (ASCII) format, so that they can be read by different software packages and different work processors. The variable names are in the first row and the columns are delimited by tab characters. To download the contents of a file do the following:
Chapter 1
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Milk Production | P004.dta | P004.txt | 004 | 199 | 7 |
Right-To-Work Law | P005.dta | P005.txt | 005 | 38 | 7 |
Egyptian Skulls | P006.dta | P006.txt | 006 | 150 | 5 |
Domestic Immigration | P008.dta | P008.txt | 008 | 48 | 6 |
Domestic Immigration | P009.dta | P009.txt | 009 | 48 | 6 |
New York Rivers | P010.dta | P010.txt | 010 | 20 | 5 |
Chapter 2
Desciption | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Perfect Nonlinear Relationship | P025a.dta | P025a.txt | 025 | 15 | 2 |
Anscombe’s Quartet | P025b.dta | P025b.txt | 025 | 11 | 8 |
Computer Repair | P027.dta | P027.txt | 027 | 14 | 2 |
Heights of Husband & Wife | P049.dta | P049.txt | 049 | 96 | 2 |
Newspapers Data | P050.dta | P050.txt | 050 | 34 | 2 |
Chapter 3
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Supervisor Performance | P054.dta | P054.txt | 054 | 30 | 7 |
Examination Data | P076.dta | P076.txt | 076 | 22 | 3 |
Cigarette Consumption | P081.dta | P081.txt | 081 | 51 | 7 |
Chapter 4
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Hamilton’s Data | P095.dta | P095.txt | 095 | 15 | 3 |
Scottish Hills Races | P112.dta | P112.txt | 112 | 35 | 3 |
Expanded Computer Repair | P117.dta | P117.txt | 117 | 24 | 2 |
Exercise 4.10 | P119.dta | P119.txt | 119 | 12 | 2 |
Exercises 4.12-4.14 | P121.dta | P121.txt | 121 | 40 | 7 |
Chapter 5
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Salary Survey | P124.dta | P124.txt | 124 | 46 | 4 |
Preemployment Testing | P134.dta | P134.txt | 134 | 20 | 3 |
Ski Sales | P143.dta | P143.txt | 143 | 40 | 3 |
Education Expenditures (1960) | P145.dta | P145.txt | 145 | 50 | 5 |
Education Expenditures (1970) | P146.dta | P146.txt | 146 | 50 | 5 |
Education Expenditures (1975) | P147.dta | P147.txt | 147 | 50 | 5 |
Corn Yield | P148.dta | P148.txt | 148 | 10 | 4 |
Class Data | P149.dta | P149.txt | 149 | 60 | 4 |
Presidential Election | P150.dta | P150.txt | 150 | 21 | 8 |
Chapter 6
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Bacteria | P157.dta | P157.txt | 157 | 15 | 2 |
Supervisors | P167.dta | P167.txt | 167 | 27 | 2 |
Brain/Body Weight | P176.dta | P176.txt | 176 | 28 | 2 |
Advertising | P177.dta | P177.txt | 177 | 41 | 2 |
Wind Chill Factor | P178.dta | P178.txt | 178 | 120 | 3 |
Crude Oil Production | P179.dta | P179.txt | 179 | 29 | 2 |
Storage Price | P180.dta | P180.txt | 180 | 11 | 2 |
Chapter 7
Description | Stata Data Files | Raw Data Files | Page | # of Cases | # of Vars |
Education Expenditure | P189.dta | P189.txt | 189 | 50 | 5 |
Chapter 8
Description | Stata Data Files | Raw Data Files | Page | # of Cases | # of Vars |
Consumer Expenditure | P203.dta | P203.txt | 203 | 20 | 4 |
Housing Starts | P211.dta | P211.txt | 211 | 25 | 3 |
Ski Sales | P217.dta | P217.txt | 217 | 40 | 3 |
DJIA | P222.dta | P222.txt | 222- 223 | 262 | 2 |
Chapter 9
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Equal Educational Opportunity | P228.dta | P228.txt | 228 | 70 | 4 |
French Economy | P233.dta | P233.txt | 233 | 18 | 5 |
Sales Expenses | P238.dta | P238.txt | 238 | 22 | 6 |
Gasoline Consumption | P259.dta | P259.txt | 259 | 30 | 12 |
Chapter 10
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
P270.dta (added by ATS) | |||||
Longley’s Data | P280.dta | P280.txt | 280 | 16 | 7 |
Hald’s Data | P281.dta | P281.txt | 281 | 13 | 5 |
Chapter 11
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Vars |
Homicides Data | P301.dta | P301.txt | 301 | 13 | 13 |
Building Prices | P313.dta | P313.txt | 313 | 24 | 10 |
Chapter 12
Description | Stata Data File | Raw Data File | Page | # of Cases | # of Variables |
Financial Ratios | /stata/examples/chp/P323.dta | P323.txt | 323 | 66 | 4 |
Space Shuttle Challenger | /stata/examples/chp/P333.dta | P333.txt | 333 | 23 | 2 |
Field Goal Kicking | /stata/examples/chp/P334.dta | P334.txt | 334 | 10 | 4 |
Note. We have created the Stata data files from the raw data files using the program makedata.do . This program illustrates how the insheet command was used to read the data files. If you are interested in reading the raw data, you can do that too. For example, to read the file p010.txt you can type the following in the Stata command window…
insheet using http://www.ats.ucla.edu/books/chp/p010.txt