T h e M a n g a G u i e t ™
REGRESSION ANALYSIS Shin Takahahi Iha Inue TREND-PRO C., Lt.
Comic Comic inide!
https://www.facebook.com/groups/stats https://www.facebo ok.com/groups/stats.ebooksandpapers/ .ebooksandpapers/
Pai Manga Manga Guid i i “Highly recommended.” — CHOICE CHOICE MAGAZINE ON THE MANGA GUIDE TO
DATABASES
“Stimulus for the next generation of scientists.” — SCIENTIFIC SCIENTIFIC
COMPUTING ON THE MANGA GUIDE TO MOLECULAR BIOLOGY
“A great fit of form and subject. Recommended.” — OTAKU OTAKU
USA MAGAZINE ON THE MANGA GUIDE TO PHYSICS
“The art is charming and the humor engaging. A fun and fairly painless lesson on what many consider to be a less-than-thrilling subject.” — SCHOOL SCHOOL
LIBRARY JOURNAL ON THE MANGA GUIDE TO STATISTICS
“This is really what a good math text should be like. Unlike the majority of books on subjects like statistics, it doesn’t just present the material as a dry series of pointlessseeming formulas. It presents statistics as something fun, and something enlightening.” — GOOD GOOD
MATH, BAD MATH ON THE MANGA GUIDE TO STATISTICS
“I found the cartoon approach of this book so compelling and its story so endearing that I recommend that every teacher of introductory physics, in both high school and college, consider using it.” — AMERICAN AMERICAN
Ww!
JOURNAL OF PHYSICS ON THE MANGA GUIDE TO PHYSICS
“The series is consistently good. A great way to introduce kids to the wonder and vastness of the cosmos.” — DISCOVERY DISCOVERY .COM ON THE MANGA GUIDE TO THE UNIVERSE “A single tortured cry will escape the lips of every thirtysomething biochem major who sees The Manga Guide to Molecular Biology : ‘Why, oh why couldn’t this have been written when I was in college?’” — THE THE
SAN FRANCISCO EXAMINER
“Scientifically solid . . . enter tainingly bizarre.” — CHAD CHAD
ORZEL , AUTHOR OF HOW TO TEACH PHYSICS TO YOUR DOG,
ON THE MANGA GUIDE TO RELATIVITY
“A lot of fun to read. The interactions between the characters are lighthearted, and the whole setting has a sort of quirkiness about it that makes you keep reading just for the joy of it.” — HACK HACK
A DAY ON THE MANGA GUIDE TO ELECTRICITY
https://www.facebook.com/groups/stats. https://www.facebo ok.com/groups/stats.ebooksandpapers/ ebooksandpapers/
“The Manga Guide to Databases was the most enjoyable tech book I’ve ever read.” — RIKKI RIKKI
KITE , LINUX PRO MAGAZINE
“The Manga Guides definitely have a place on my bookshelf.” — SMITHSONIAN SMITHSONIAN’S “SURPRISING SCIENCE” “For parents try ing to give their kids an edge or just for kids with a curiosity about their electronics, The Manga Guide to Electricity should should definitely be on their bookshelves.” — SACRAMENTO SACRAMENTO
BOOK REVIEW
“This is a solid book and I wish there were more like it in the IT world.” — SLASHDOT S LASHDOT ON THE MANGA GUIDE TO DATABASES “The Manga Guide to Electricity makes makes accessible a very intimidating subject, letting the reader have fun while still delivering the goods.” — GEEKDAD GEEKDAD
BLOG, WIRED.COM
“If you want to introduce a subject that kids wouldn’t normally be very interested in, give it an amusing storyline and wrap it in cartoons.” — MAKE M AKE
ON THE MANGA GUIDE TO STATISTICS
“A clever blend that makes r elativity easier to think about—even if you’re no Einstein.” Einstein.” — STARDATE STARDATE,
UNIVERSITY OF TEXAS, ON THE MANGA GUIDE TO RELATIVITY
“This book does exactly what it is supposed to: offer a fun, interesting way to learn calculus concepts that would otherwise be extremely bland to memorize.” — DAILY DAILY TECH
ON THE MANGA GUIDE TO CALCULUS
“The art is fantastic, and the teaching method is both fun and educational.” — ACTIVE A CTIVE
ANIME ON THE MANGA GUIDE TO PHYSICS
“An awfully fun, highly educational read.” — FRAZZLEDDAD F RAZZLEDDAD
ON THE MANGA GUIDE TO PHYSICS
“Makes it possible for a 10-year-old to develop a decent working knowledge of a subject that sends most college students running for the hills.” — SKEPTICBLOG SKEPTICBLOG
ON THE MANGA GUIDE TO MOLECULAR BIOLOGY
“This book is by far the best book I have read on the subject. I think this book absolutely rocks and recommend it to anyone working with or just interested in databases.” — GEEK GEEK
AT LARGE ON THE MANGA GUIDE TO DATABASES
“The book purposefully departs from a traditional physics textbook and it does it very well.” — DR DR .
MARINA MILNER-BOLOTIN, RYERSON UNIVERSITY ON THE MANGA GUIDE TO PHYSICS
“Kids would be, I think, much more likely to actually pick this up and find out if they are interested in statistics as opposed to a regular textbook.” — GEEK GEEK
BOOK ON THE MANGA GUIDE TO STATISTICS
https://www.facebook.com/groups/stats.eb https://www.faceboo k.com/groups/stats.ebooksandpapers/ ooksandpapers/
T Maa Gui™ Rsi Aal Aa lyi
https://www.facebook.com/groups/stats.e https://www.faceboo k.com/groups/stats.ebooksandpapers/ booksandpapers/
https://www.facebook.com/groups/stats. https://www.facebo ok.com/groups/stats.ebooksandpapers/ ebooksandpapers/
T Maa Gui™
REGREsION ANALYSIS
Si Takaai, Ia Iu, a T-P C., L.
T Maa Gui Rsi Aalyi. Copyright © 2016 by Shin Takahashi and TR END-PRO Co., Ltd. The Manga Guide to Regression Analysis is a tr anslation of the Japanese Japanese original, Manga de wakaru toˉ kei-gaku kei- gaku kaiki kai ki bunseki-hen bunsek i-hen , published by Ohmsha, Ltd. of Tokyo, Japan, © 2005 by Shin Takahashi
and TREND-PRO Co., Ltd. This English edition is co -published -published by No St arch Press, Inc. a nd Ohmsha, Ltd. All r ights reserv re served. ed. No par t of this work may b be e reproduced reproduce d or tra nsmitted nsmitte d in any form or by a ny means, electronic or mechanical, including photocopying, recording, or by any informat ion storage or retrieva l system, without the prior wr itten permission of the copyr ight owner and the publisher. publisher. First printing 20 19 18 17 16
123456789
ISBN-10: 1-59327-7281-59327-728-8 8 ISBN-13: 978-1-59327-728978-1-59327-728- 4 Publisher: Publisher: Willia m Pollock Author: Shin Shi n Takahashi Takah ashi Illustrator: Iroha Inoue Producer: TREND-PRO Co., Ltd. Production Editor: Serena Yang Developmental Developmental Ed itors: Liz Chadwick and Tyler Ortman Technical Reviewers: James Church, Church, Dan Fur nas, and Alex Reinhar t Compositor: Susan Glinert Stevens Copyeditor: Paula L. Fleming Proofreader: Alison Law Indexer: BIM Creatives, LLC. For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 245 8th Street , San Fr ancisco, CA 94103 94103 phone: phone: 415.863.9900; 415.863.9900;
[email protected]; http://www.nostarch.com/ Library of Congress Cataloging-in-Publication Data
Names: Takaha shi, Shin. | Inoue, Iroha. | Trend-pro Co. Title: The manga guide to regression analysis / by Shin Takahashi, Iroha Inoue, and Trend-Pro Co., Ltd. Other titles: Manga de wakaru tåokeigaku. Kaiki bunsekihen. English Description: San F rancisco : No Starch Pre ss, [2016] [2016] | Includes index. Identifiers: LCCN 2016000594 (print) | LCCN 2016003356 (ebook) (ebook) | ISBN 9781593277284 | ISBN 1593277288 | ISBN 9781593277529 (epub) | ISBN 9781593277536 (mobi) Subjects: LCSH: Regression analy sis. | Graphic novels. Classific ation: LCC Q A278.2 .T34713 .T34713 2016 2016 (print) | LCC Q A278.2 (ebook) (ebook) | DDC 519.5/36--dc23 LC record avai lable at http://lccn.loc.gov/2016000594 http://lccn.loc.gov/2016000594
No Starch Press and t he No Starch Press logo are registered tr ademarks of No Starch Press, Inc. Other product and company names mentioned herein may be t he trademarks of t heir respective owners. Rather than use a t rademark symbol with every occurrence of a trademarked name, we are using the na mes only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the tr ademark. The information in this book is d istributed on an “As Is” Is” basis, without warranty. While every precaution has been taken in t he preparation of this work, neither the author nor nor No Starch Press, Inc. shall have any liability t o any person or entity with respect to any loss or da mage caused or alleged to be caused directly or indirectly by the information contained in it. All charac c haracters ters in t his publicat ion are fictit fic titious, ious, and any re semblance to t o real persons, p ersons, liv ing or dead, dead , is purely coincidental.
C Pa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Plu M Ta? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 A Ri Glas Ma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 11 Building a Foundation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 12 Inverse Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 14 Exponents and Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 19 9 Rules for Exponents and Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 21 Differential Ca Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 24 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 37 Adding Matrices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Multiplying Ma Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 40 The Rules of Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 43 Identity and Inverse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 44 Statistical Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 46 6 Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 48 Measuring Variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 49 Sum of Squared Deviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 50 Variance. Variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Standard Deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 51 Probability Density Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 52 Normal Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 53 3 Chi-Squared Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 54 Probability Density Distribution Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 F Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 57
2 Sil Rsi Aalyi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 First Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 62 Plotting the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 64 The Regression Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 66 6 General Regression Analysis Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 68 Step 1: Draw a scatter plot of the independent variable versus the dependent dependent variable. If the dots line up, the variables may be correlated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 69 Step 2: Calculate the regression equation . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Step 3: Calculate the correlation coefficient (R ) and assess our population and assumptions . . . . . . . . . . . . . . . . . . . . . . . . 78 Samples and Populations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 82 2
https://www.facebook.com/groups/stats. https://www.facebo ok.com/groups/stats.ebooksandpapers/ ebooksandpapers/
Assumptions Assumptions of Normality. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Step 4: Conduct the analysis of variance . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Step 5: Calculate the confidence intervals . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Step 6: Make a prediction! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 95 Which Steps Are Are Necessary?. Necessary? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Standardized Residual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 10 00 Interpolation and Extrapolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 10 02 Autocorrelation Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Nonlinear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 10 03 Tran ransfo sformin rming g Nonlin nlinea earr Equ Equati ations ons into into Linea inearr Equat uations ions . . . . . . . . . . . . . . . 104 104
3 Mulil Mulil Rsi Rsi Aalyi Aalyi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Predicting wi with Ma Many Va Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1 08 The Multiple Regression Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1 12 Multiple Regression Analysis Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Step 1: Draw a scatter plot of each predictor variable and the outcome va variable to to se see if if th they ap appear to to be be re related . . . . . . . . . . . . . . 113 Step 2: 2: Ca Calculate th the mu multiple re regression eq equation . . . . . . . . . . . . . . . . . . 115 Step 3: Examine Examine the accuracy accuracy of the multiple multiple regression regression equation equation . . . . . 119 2 The Trouble with R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 122 2 Adjusted R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 124 H ypothesis Testing Testing with Multiple Multiple Regression. . . . . . . . . . . . . . . . . . . . . . . . . . 127 Step tep 4: Conduc nductt the Anal nalysis ysis of Varia arianc nce e (AN (ANOVA OVA) Test . . . . . . . . . . . . . . 128 Finding S11 and S22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 132 Step tep 5: 5: Cal Calcu cula latte con confi fid dence ence int interv ervals als fo for the the popul opulat atiion. . . . . . . . . . . . . 133 Step 6: Make Make a prediction! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Choosing th the Be Best Co Combination of of Pr Predictor Va Variables . . . . . . . . . . . . . . . . . . 138 Assessing Populations Populations with Multiple Multiple Regression Analysis Analysis . . . . . . . . . . . . . . . 142 Standardized Re Residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 14 43 Mahalanobis Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 144 Step 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 144 Step 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 145 Step 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 146 Using Ca Categorical Da Data in in Mu Multiple Re Regression An Analysis . . . . . . . . . . . . . . . . . 147 Multicollinearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 149 Determining the Relative Influence of Predictor Variables on the Outcome Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1 49
4 Lii Rsi Aalyi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 153 The Final Lesson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 154 The Maximum Likelihood Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 16 60 Findin Finding g the the Maxim Maximum um Lik Likeli elihoo hood d Usin Using g the the Like Likelih lihoo ood d Func Functio tion n . . . . . . 163 163 Choosing Predictor Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 164
viii C
https://www.facebook.com/groups/stats.eb https://www.faceboo k.com/groups/stats.ebooksandpapers/ ooksandpapers/
Logistic Regression Analysis in Action! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1 68 Logistic Regression Analysis Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Step 1: Draw a scatter plot of the predictor variables and the outc outcom ome e var varia iabl ble e to to see see whet whethe herr the they y app appea earr to to be be rel relat ated ed . . . . . . . . 169 169 Step 2: Ca Calculate th the lo logistic re regression eq equation. . . . . . . . . . . . . . . . . . . 170 Step 3: Assess the accuracy of the equation . . . . . . . . . . . . . . . . . . . . . . . 173 Step 4: Conduct the hypothesis tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1 78 Step 5: Predict whether the No Norns Sp Special will sell . . . . . . . . . . . . . . . . . . 182 Logistic Re Regression Analysis in the Re Real Wo World . . . . . . . . . . . . . . . . . . . . . . . . 190 Logit, Odds Ratio, and Relative Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1 90 Logit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 190 Odds Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 191 Adjusted Odds Odds Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Hypothesis Testing with Odds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 19 94 Confidence Interval for an Odds Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Relative Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 195
Apix Rsi Calulai Calulai wi Exl . . . . . . . . . . . . . . . . . . . . . . . . . . 19 197 Euler’s Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 198 Powers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 200 Natural Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 200 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 20 01 Matrix Inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 202 Calculating a Chi-Squared Statistic from a p-Value . . . . . . . . . . . . . . . . . . . . . 204 Calculating a p-Value from a Chi-Squared Statistic . . . . . . . . . . . . . . . . . . . . . 205 Calculating an F Statistic from a p-Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 Calculating a p-Value from an F Statistic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 Part Partia iall Regr Regres essi sion on Coeff Coeffic icie ient nt of a Mult Multip iple le Regr Regres essi sion on Anal Analys ysis is . . . . . . . . . . 209 209 Regre egress ssiion Coeffi effici cien entt of a Logi Logis stic tic Regre egress ssio ion n Equat quatiion . . . . . . . . . . . . . . . 210 210
Ix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 213
https://www.facebook.com/groups/stats.e https://www.faceboo k.com/groups/stats.ebooksandpapers/ booksandpapers/
C ix
https://www.facebook.com/groups/stats https://www.faceb ook.com/groups/stats.ebooksandpapers/ .ebooksandpapers/
Pa This book is an introduction to regression analysis, covering simple, multiple, and logistic regression analysis. Simple and multiple regression analysis are statistical methods for predicting values; for example, you can use simple regression analysis to predict the number of iced tea orders based on the day’s high temperature or use multiple regression analysis to predict monthly sales of a shop based on its size and distance from the nearest train station. Logistic regression analysis is a method for predicting probability, such as the probability of selling a particular cake based on a certain day of the week. The intended readers of this book are statistics and math students who’ve found it difficult to grasp regression analysis, or anyone wanting to get started with statistical predictions and probabilities. You’ll need some basic statistical knowledge before you start. The Manga Guide to Statistics (No Starch Press, 2008) is an excellent primer to prepare you for the work in this book. This book consists of four chapters: ch apters: •
•
•
•
Chapter 1: A Refreshing Glass of Math Chapter 2: Simple Regression Analysis Chapter 3: Multiple Regression Analysis Chapter 4: Logistic Regression Analysis
Each chapter has a manga section and a slightly more technical text section. You You can get a basic overview from the t he manga, and some more useful details and definitions from the text sections. I’d like to mention a few words about Chapter 1. Although ma ny readers may have already learned the topics in this chapter, like differentiation and matrix operations, Chapter 1 reviews these topics in context of regression analysis, which will be useful for the lessons that follow. If Chapter 1 is merely a refresher for you, that’s great. If you’ve never studied those topics or it’s been a long time since you have, it’s worth putting in a bit of effort to make sure you understand Chapter 1 first. In this book, the math for the calculations is covered in detail. If you’re good at math, you should be able to follow along and make sense of the calculations. If you’re you’re not so good at math, you can just get get an overv iew of the procedure and use the step-by-step instructions to find the actual answers. You don’t need to force yourself to understand the t he math part par t right now. now. Keep yourself relaxed. However, do take a look at the procedure of the calculations.
We’ve We’ve rounded some of the figures in this th is book to make them easier to read, which means that some of the values may be inconsistent with the values you will get by calculating calculat ing them yourself, though not by much. We ask for for your understanding. I would like to thank my publisher, Ohmsha, for giving me the opportunity to write this book. I would also like to thank TREND-PRO, Co., Ltd. for turning my manuscript into this manga, the scenario writer re_akino, and the illustrator Iroha Inoue. Last but not least, I would like to thank Dr. Sakaori Fumitake of College of Social Relations, Rikkyo University. He provided with me invaluable advice, much more than he had given me when I was preparing my previous book. I’d like to express my deep appreciation. Shin Takahashi September 2005
xii Pa
Prologue Prologue
M Ta?
I lv i a . .
Evyi i Dliiu!
I' u w .
Wa bi yu by ay? Suyi a uual?
...
w�...
2 Plu
mik
...I ju lik i .
Y?
I yu ay ... Ejy yu a.
Wa' w, Miu?
M Ta? 3
N! O u !
D' b baras.
I' ju... yu a alk ay!
O? A yu jalu, Miu?
Pek!
H' alway ai bok abu ava aai.
H u b a o u. u.
4 Plu
Hy! W' i aj, o, a' w?
n g l e J i i n n g l e J i i n My a a' o lik yu, Ria.
S ak i l yu uy.
I a' a! I ' v kw i a.
T ak i a i!
e! ic e plac N ic
bluh
W o w !
Bi, alway e buy.
Hi!
Wl Ta Ro!
O h h , C u u s st t m m e e s ! s !
Cl o s i n g e! im t im
Ca I yu i ik?
Pla ak ay a yu lik.
I wnd i h'� m m in again on... on...
Wa' i?
M Ta? 5
H l i bok. l e s h u f l e s h u f
Wa?
Wa wa ai?
Di i?
e d l z z D a
H.
Um...
*
i y l a n a n o i s e r g e r o t n o i t c u d o r t n I * 6 Plu
Ta' a aiial aal aa lyi!
I'v v a i.
Miu, yu k wa wa a a i i? Rsi aalyi? aalyi?
Y, Y, u.
Sup w w kei a i au a ub ub i a a u vy ay.
31° 31° C Tay' Tay' i wi� b 31°C.
b i n g !
Tay' Tay' i wi� b 27°C.
Hi 31°C...
i c ce d
? t e a
ay, ay, w i 61 i a!
a ic ic d t
Ui lia si aalyi, yu a ia ia ub u b i a ba i i au! au!
T' al a iila ii la y aal aa lyi a� ulil lia si.
Ww! Ta' a�y ol.
Mulil lia? L li??
Bu i ulil ulil lia si si aaly a alyi, i, w u u val a, a, lik au, au, i i a, a ub u aki las aby.
qui.
WE u lia si ia ub i a ba a— au. au.
f a ct o r
E s t i m a t i o n
Rsi aalyi
Fat E s t i m a t ti o n
ulil ulil lia si aalyi
M Ta? 7
L' lok a a xal ulil lia si aalyi. aalyi.
Store
Distance to nearest nearest competing store (m)
Houses within a mile of the store
Advertising expenditure (yen)
Sales (yen)
M. Guya i CEO a ai . . I a dii dii aki al, al ke ke �wi a i i : : •
•
•
Dia a i Nub u wii a il avii xiu xiu M. Guya
W i ii i a w ... ...
...H a ia ia al a w ba w e a a la al a i xii xii .
I ul a�y a�y a w !
Aai!
p ? s h o w e N
huld I n it?
T a aalyi, o, o, lik lii lii si aalyi. aalyi.
T a ay...
8 Plu
I I tudy thi bok... bok...
thn mayb... mayb...
On day I an talk t him abut it. it.
Ria, Ca I ak yu a av?
I'� ju l i bok uil bak.
Hu?
Wi� yu a si aalyi? aalyi?
ty la?
W�...
Su, kay. kay.
REa�y?
M Ta? 9
Ta wul b vy ki yu.
Bu ly i yu ae iv a a bok bak i yul, kay?
W�, u...I us I ul ke i a uil i aai.
Yu ik '� kw w lok? lok?
Yu ik?
I' u '� iu i u.
w�, e yu rw!
Ya... o i...
! h s u B l Y, on! I' u '� b bak o.
10 Plu
1 A Ri Ri Glas Ma
T bs a ia�y , a ul w!
Buili a Fuai Fuai
Phw!
U, Ria, ul w a a ls i?
Siuly? Yu wa a a w?! nd
I'v v e yu xi la! la! Uua� Uua �y yu a i las. las.
Sry...
Ya, i' ju... I ...
12 Ca 1 A Ri Glas Ma
I i' a baras yu.
I’� wi u ls, ak la.
Su, l’ i. Rsi a...
w’� a wi a.
A� i, Wav yu ay!
O u ba?
Su, yu a wi u a ls.
Nai ul
E a l r e p ! I f o a r e p e g o t d y c a i l t h e !
Cu a a l a u, bu i yu kw w i yul, yu’� av a e uai si. G i.
Buili a Fuai 13
Iv Fui
Fi, Fi, I'� xlai inv untin ui ui lia ui y = 2 x + + 1 a a xal.
W x i i , wa i valu y?
Hw abu w x i i 3?
I' 7.
I' 1.
T valu y dnd valu x .
S W a� y utm , vaiabl, vaiab l, a x dit dit , i vaiabl.
Yu ul ay a i bs y. x i
I' iy! Wa' 2 ub?
Y.
14 Ca 1 A Ri Glas Ma
Bs
Yu ik, i. 8.
SEva