100% found this document useful (22 votes)
97 views

Beginning R An Introduction to Statistical Programming 2nd ed. Edition Larry Pace 2024 scribd download

R

Uploaded by

ambusdulcini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (22 votes)
97 views

Beginning R An Introduction to Statistical Programming 2nd ed. Edition Larry Pace 2024 scribd download

R

Uploaded by

ambusdulcini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Download the full version of the ebook at ebookname.

com

Beginning R An Introduction to Statistical


Programming 2nd ed. Edition Larry Pace

https://ebookname.com/product/beginning-r-an-introduction-
to-statistical-programming-2nd-ed-edition-larry-pace/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

An introduction to bioceramics 2nd edition Larry L Hench

https://ebookname.com/product/an-introduction-to-bioceramics-2nd-
edition-larry-l-hench/

ebookname.com

Introduction to Criminal Justice 16th ed. Edition Larry J.


Siegel

https://ebookname.com/product/introduction-to-criminal-justice-16th-
ed-edition-larry-j-siegel/

ebookname.com

Beginning programming with Java for dummies 2nd ed Edition


Barry A Burd

https://ebookname.com/product/beginning-programming-with-java-for-
dummies-2nd-ed-edition-barry-a-burd/

ebookname.com

Safe Management of Wastes from Health care Activities A


Practical Guide 2nd ed. Edition J.

https://ebookname.com/product/safe-management-of-wastes-from-health-
care-activities-a-practical-guide-2nd-ed-edition-j/

ebookname.com
Democratization in Africa Challenges and Prospects 1st
Edition Gordon Crawford

https://ebookname.com/product/democratization-in-africa-challenges-
and-prospects-1st-edition-gordon-crawford/

ebookname.com

Starting strength basic barbell training 3rd ed Edition


Mark Rippetoe

https://ebookname.com/product/starting-strength-basic-barbell-
training-3rd-ed-edition-mark-rippetoe/

ebookname.com

Inside the Patent Factory The Essential Reference for


Effective and Efficient Management of Patent Creation 1st
Edition Donal O'Connell
https://ebookname.com/product/inside-the-patent-factory-the-essential-
reference-for-effective-and-efficient-management-of-patent-
creation-1st-edition-donal-oconnell/
ebookname.com

Agrobacterium Protocols 2nd Edition Kan Wang (Ed.)

https://ebookname.com/product/agrobacterium-protocols-2nd-edition-kan-
wang-ed/

ebookname.com

Exploring the Powers of Your Inner Mind Jaime T. Licauco

https://ebookname.com/product/exploring-the-powers-of-your-inner-mind-
jaime-t-licauco/

ebookname.com
Elusive Togetherness Church Groups Trying to Bridge
America s Divisions Paul Lichterman

https://ebookname.com/product/elusive-togetherness-church-groups-
trying-to-bridge-america-s-divisions-paul-lichterman/

ebookname.com
Beginning R
An Introduction to Statistical
Programming
Second Edition

Dr. Joshua F. Wiley


Larry A. Pace
Beginning R
Copyright © 2015 by Dr. Joshua F. Wiley and the estate of Larry A. Pace
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection with
reviews or scholarly analysis or material supplied specifically for the purpose of being entered and executed
on a computer system, for exclusive use by the purchaser of the work. Duplication of this publication or
parts thereof is permitted only under the provisions of the Copyright Law of the Publisher's location, in its
current version, and permission for use must always be obtained from Springer. Permissions for use may be
obtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution under
the respective Copyright Law.
ISBN-13 (pbk): 978-1-4842-0374-3
ISBN-13 (electronic): 978-1-4842-0373-6
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director: Welmoed Spahr
Lead Editor: Steve Anglin
Technical Reviewer: Sarah Stowell
Editorial Board: Steve Anglin, Louise Corrigan, Jonathan Gennick, Robert Hutchinson,
Michelle Lowman, James Markham, Susan McDermott, Matthew Moodie, Jeffrey Pepper,
Douglas Pundick, Ben Renow-Clarke, Gwenan Spearing, Steve Weiss
Coordinating Editor: Mark Powers
Copy Editor: Lori Jacobs
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springer.com. Apress Media, LLC is a California LLC and the
sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance
Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our Special
Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this text is available to
readers at www.apress.com/9781484203743. For detailed information about how to locate your book’s source
code, go to www.apress.com/source-code/. Readers can also access source code at SpringerLink in the
Supplementary Material section for each chapter.
To Family.
Contents at a Glance

About the Author�����������������������������������������������������������������������������������������������������xv


In Memoriam���������������������������������������������������������������������������������������������������������xvii
About the Technical Reviewer��������������������������������������������������������������������������������xix
Acknowledgments��������������������������������������������������������������������������������������������������xxi
Introduction����������������������������������������������������������������������������������������������������������xxiii


■Chapter 1: Getting Star ted������������������������������������������������������������������������������������� 1

■Chapter 2: Dealing with Dates, Strings, and Data Frames����������������������������������� 15

■Chapter 3: Input and Output�������������������������������������������������������������������������������� 27

■Chapter 4: Control Structures������������������������������������������������������������������������������ 35

■Chapter 5: Functional Programming������������������������������������������������������������������� 43

■Chapter 6: Probability Distributions�������������������������������������������������������������������� 53

■Chapter 7: Working with Tables��������������������������������������������������������������������������� 67

■Chapter 8: Descriptive Statistics and Exploratory Data Analysis������������������������ 73

■Chapter 9: Working with Graphics����������������������������������������������������������������������� 81

■Chapter 10: Traditional Statistical Methods�������������������������������������������������������� 93

■Chapter 11: Modern Statistical Methods����������������������������������������������������������� 101

■Chapter 12: Analysis of Variance���������������������������������������������������������������������� 111

■Chapter 13: Correlation and Regression������������������������������������������������������������ 121

■Chapter 14: Multiple Regression����������������������������������������������������������������������� 139

■Chapter 15: Logistic Regression������������������������������������������������������������������������ 163

v
■ Contents at a Glance


■Chapter 16: Modern Statistical Methods II�������������������������������������������������������� 193

■Chapter 17: Data Visualization Cookbook��������������������������������������������������������� 215

■Chapter 18: High-Performance Computing�������������������������������������������������������� 279

■Chapter 19: Text Mining������������������������������������������������������������������������������������ 303

Index��������������������������������������������������������������������������������������������������������������������� 321

vi
Contents

About the Author�����������������������������������������������������������������������������������������������������xv


In Memoriam���������������������������������������������������������������������������������������������������������xvii
About the Technical Reviewer��������������������������������������������������������������������������������xix
Acknowledgments��������������������������������������������������������������������������������������������������xxi
Introduction����������������������������������������������������������������������������������������������������������xxiii


■Chapter 1: Getting Star ted������������������������������������������������������������������������������������� 1
1.1 What is R, Anyway?���������������������������������������������������������������������������������������������������� 1
1.2 A First R Session�������������������������������������������������������������������������������������������������������� 3
1.3 Your Second R Session����������������������������������������������������������������������������������������������� 6
1.3.1 Working with Indexes�������������������������������������������������������������������������������������������������������������������� 6
1.3.2 Representing Missing Data in R���������������������������������������������������������������������������������������������������� 7
1.3.3 Vectors and Vectorization in R������������������������������������������������������������������������������������������������������� 8
1.3.4 A Brief Introduction to Matrices����������������������������������������������������������������������������������������������������� 9
1.3.5 More on Lists������������������������������������������������������������������������������������������������������������������������������� 11
1.3.6 A Quick Introduction to Data Frames������������������������������������������������������������������������������������������� 12


■Chapter 2: Dealing with Dates, Strings, and Data Frames����������������������������������� 15
2.1 Working with Dates and Times��������������������������������������������������������������������������������� 15
2.2 Working with Strings������������������������������������������������������������������������������������������������ 16
2.3 Working with Data Frames in the Real World����������������������������������������������������������� 18
2.3.1 Finding and Subsetting Data������������������������������������������������������������������������������������������������������� 19

2.4 Manipulating Data Structures���������������������������������������������������������������������������������� 21


2.5 The Hard Work of Working with Larger Datasets������������������������������������������������������ 22

vii
■ Contents


■Chapter 3: Input and Output�������������������������������������������������������������������������������� 27
3.1 R Input���������������������������������������������������������������������������������������������������������������������� 27
3.1.1 The R Editor��������������������������������������������������������������������������������������������������������������������������������� 28
3.1.2 The R Data Editor������������������������������������������������������������������������������������������������������������������������� 29
3.1.3 Other Ways to Get Data Into R����������������������������������������������������������������������������������������������������� 30
3.1.4 Reading Data from a File������������������������������������������������������������������������������������������������������������� 31
3.1.5 Getting Data from the Web���������������������������������������������������������������������������������������������������������� 31

3.2 R Output������������������������������������������������������������������������������������������������������������������� 33
3.2.1 Saving Output to a File���������������������������������������������������������������������������������������������������������������� 33


■Chapter 4: Control Structures������������������������������������������������������������������������������ 35
4.1 Using Logic��������������������������������������������������������������������������������������������������������������� 35
4.2 Flow Control������������������������������������������������������������������������������������������������������������� 36
4.2.1 Explicit Looping��������������������������������������������������������������������������������������������������������������������������� 36
4.2.2 Implicit Looping��������������������������������������������������������������������������������������������������������������������������� 38

4.3 If, If-Else, and ifelse( ) Statements���������������������������������������������������������������������������� 41



■Chapter 5: Functional Programming������������������������������������������������������������������� 43
5.1 Scoping Rules���������������������������������������������������������������������������������������������������������� 44
5.2 Reserved Names and Syntactically Correct Names������������������������������������������������� 45
5.3 Functions and Arguments���������������������������������������������������������������������������������������� 46
5.4 Some Example Functions����������������������������������������������������������������������������������������� 47
5.4.1 Guess the Number����������������������������������������������������������������������������������������������������������������������� 47
5.4.2 A Function with Arguments��������������������������������������������������������������������������������������������������������� 48

5.5 Classes and Methods����������������������������������������������������������������������������������������������� 49


5.5.1 S3 Class and Method Example���������������������������������������������������������������������������������������������������� 49
5.5.2 S3 Methods for Existing Classes������������������������������������������������������������������������������������������������� 50

viii
■ Contents


■Chapter 6: Probability Distributions�������������������������������������������������������������������� 53
6.1 Discrete Probability Distributions����������������������������������������������������������������������������� 53
6.2 The Binomial Distribution����������������������������������������������������������������������������������������� 54
6.2.1 The Poisson Distribution�������������������������������������������������������������������������������������������������������������� 57
6.2.2 Some Other Discrete Distributions���������������������������������������������������������������������������������������������� 58

6.3 Continuous Probability Distributions������������������������������������������������������������������������ 58


6.3.1 The Normal Distribution��������������������������������������������������������������������������������������������������������������� 58
6.3.2 The t Distribution������������������������������������������������������������������������������������������������������������������������� 61
6.3.3 The t distribution�������������������������������������������������������������������������������������������������������������������������� 63
6.3.4 The Chi-Square Distribution�������������������������������������������������������������������������������������������������������� 64

References��������������������������������������������������������������������������������������������������������������������� 65

■Chapter 7: Working with Tables��������������������������������������������������������������������������� 67
7.1 Working with One-Way Tables���������������������������������������������������������������������������������� 67
7.2 Working with Two-Way Tables���������������������������������������������������������������������������������� 71

■Chapter 8: Descriptive Statistics and Exploratory Data Analysis������������������������ 73
8.1 Central Tendency������������������������������������������������������������������������������������������������������ 73
8.1.1 The Mean������������������������������������������������������������������������������������������������������������������������������������� 73
8.1.2 The Median���������������������������������������������������������������������������������������������������������������������������������� 74
8.1.3 The Mode������������������������������������������������������������������������������������������������������������������������������������� 75

8.2 Variability������������������������������������������������������������������������������������������������������������������ 76
8.2.1 The Range������������������������������������������������������������������������������������������������������������������������������������ 76
8.2.2 The Variance and Standard Deviation������������������������������������������������������������������������������������������ 77

8.3 Boxplots and Stem-and-Leaf Displays��������������������������������������������������������������������� 78


8.4 Using the fBasics Package for Summary Statistics������������������������������������������������� 79
References��������������������������������������������������������������������������������������������������������������������� 80

ix
■ Contents


■Chapter 9: Working with Graphics����������������������������������������������������������������������� 81
9.1 Creating Effective Graphics�������������������������������������������������������������������������������������� 81
9.2 Graphing Nominal and Ordinal Data������������������������������������������������������������������������� 82
9.3 Graphing Scale Data������������������������������������������������������������������������������������������������� 84
9.3.1 Boxplots Revisited����������������������������������������������������������������������������������������������������������������������� 84
9.3.2 Histograms and Dotplots������������������������������������������������������������������������������������������������������������� 86
9.3.3 Frequency Polygons and Smoothed Density Plots����������������������������������������������������������������������� 87
9.3.4 Graphing Bivariate Data��������������������������������������������������������������������������������������������������������������� 89

References��������������������������������������������������������������������������������������������������������������������� 92

■Chapter 10: Traditional Statistical Methods�������������������������������������������������������� 93
10.1 Estimation and Confidence Intervals���������������������������������������������������������������������� 93
10.1.1 Confidence Intervals for Means������������������������������������������������������������������������������������������������� 93
10.1.2 Confidence Intervals for Proportions����������������������������������������������������������������������������������������� 94
10.1.3 Confidence Intervals for the Variance���������������������������������������������������������������������������������������� 95

10.2 Hypothesis Tests with One Sample������������������������������������������������������������������������ 96


10.3 Hypothesis Tests with Two Samples����������������������������������������������������������������������� 98
References������������������������������������������������������������������������������������������������������������������� 100

■Chapter 11: Modern Statistical Methods����������������������������������������������������������� 101
11.1 The Need for Modern Statistical Methods������������������������������������������������������������ 101
11.2 A Modern Alternative to the Traditional t Test������������������������������������������������������� 102
11.3 Bootstrapping������������������������������������������������������������������������������������������������������� 104
11.4 Permutation Tests������������������������������������������������������������������������������������������������� 107
References������������������������������������������������������������������������������������������������������������������� 109

x
■ Contents


■Chapter 12: Analysis of Variance���������������������������������������������������������������������� 111
12.1 Some Brief Background��������������������������������������������������������������������������������������� 111
12.2 One-Way ANOVA��������������������������������������������������������������������������������������������������� 112
12.3 Two-Way ANOVA��������������������������������������������������������������������������������������������������� 114
12.3.1 Repeated-Measures ANOVA����������������������������������������������������������������������������������������������������� 115
> results <- aov ( fitness ~ time + Error (id / time ), data = repeated) ��������������������������������������������� 116
12.3.2 Mixed-Model ANOVA���������������������������������������������������������������������������������������������������������������� 118

References������������������������������������������������������������������������������������������������������������������� 120

■Chapter 13: Correlation and Regression������������������������������������������������������������ 121
13.1 Covariance and Correlation���������������������������������������������������������������������������������� 121
13.2 Linear Regression: Bivariate Case������������������������������������������������������������������������ 123
13.3 An Extended Regression Example: Stock Screener���������������������������������������������� 129
13.3.1 Quadratic Model: Stock Screener�������������������������������������������������������������������������������������������� 131
13.3.2 A Note on Time Series������������������������������������������������������������������������������������������������������������� 134

13.4 Confidence and Prediction Intervals��������������������������������������������������������������������� 135


References������������������������������������������������������������������������������������������������������������������� 137

■Chapter 14: Multiple Regression����������������������������������������������������������������������� 139
14.1 The Conceptual Statistics of Multiple Regression������������������������������������������������ 139
14.2 GSS Multiple Regression Example����������������������������������������������������������������������� 141
14.2.1 Exploratory Data Analysis�������������������������������������������������������������������������������������������������������� 141
14.2.2 Linear Model (the First)����������������������������������������������������������������������������������������������������������� 147
14.2.3 Adding the Next Predictor�������������������������������������������������������������������������������������������������������� 149
14.2.4 Adding More Predictors����������������������������������������������������������������������������������������������������������� 151
14.2.5 Presenting Results������������������������������������������������������������������������������������������������������������������� 158

14.3 Final Thoughts������������������������������������������������������������������������������������������������������ 161


References������������������������������������������������������������������������������������������������������������������� 161

xi
■ Contents


■Chapter 15: Logistic Regression������������������������������������������������������������������������ 163
15.1 The Mathematics of Logistic Regression������������������������������������������������������������� 163
15.2 Generalized Linear Models����������������������������������������������������������������������������������� 164
15.3 An Example of Logistic Regression���������������������������������������������������������������������� 165
15.3.1 What If We Tried a Linear Model on Age?�������������������������������������������������������������������������������� 166
15.3.2 Seeing If Age Might Be Relevant with Chi Square������������������������������������������������������������������� 167
15.3.3 Fitting a Logistic Regression Model���������������������������������������������������������������������������������������� 168
15.3.4 The Mathematics of Linear Scaling of Data����������������������������������������������������������������������������� 169
15.3.5 Logit Model with Rescaled Predictor��������������������������������������������������������������������������������������� 170
15.3.6 Multivariate Logistic Regression��������������������������������������������������������������������������������������������� 174

15.4 Ordered Logistic Regression�������������������������������������������������������������������������������� 179


15.4.1 Parallel Ordered Logistic Regression��������������������������������������������������������������������������������������� 180
15.4.2 Non-Parallel Ordered Logistic Regression������������������������������������������������������������������������������� 184

15.5 Multinomial Regression���������������������������������������������������������������������������������������� 187


References������������������������������������������������������������������������������������������������������������������� 192

■Chapter 16: Modern Statistical Methods II�������������������������������������������������������� 193
16.1 Philosophy of Parameters������������������������������������������������������������������������������������ 193
16.2 Nonparametric Tests�������������������������������������������������������������������������������������������� 194
16.2.1 Wilcoxon-Signed-Rank Test����������������������������������������������������������������������������������������������������� 194
16.2.2 Spearman’s Rho���������������������������������������������������������������������������������������������������������������������� 195
16.2.3 Kruskal-Wallis Test������������������������������������������������������������������������������������������������������������������ 196
16.2.4 One-Way Test��������������������������������������������������������������������������������������������������������������������������� 198

16.3 Bootstrapping������������������������������������������������������������������������������������������������������� 199


16.3.1 Examples from mtcars������������������������������������������������������������������������������������������������������������ 200
16.3.2 Bootstrapping Confidence Intervals���������������������������������������������������������������������������������������� 203
16.3.3 Examples from GSS����������������������������������������������������������������������������������������������������������������� 206

16.4 Final Thought�������������������������������������������������������������������������������������������������������� 213


References������������������������������������������������������������������������������������������������������������������� 213

xii
■ Contents


■Chapter 17: Data Visualization Cookbook��������������������������������������������������������� 215
17.1 Required Packages���������������������������������������������������������������������������������������������� 215
17.2 Univariate Plots���������������������������������������������������������������������������������������������������� 215
17.3 Customizing and Polishing Plots�������������������������������������������������������������������������� 226
17.4 Multivariate Plots������������������������������������������������������������������������������������������������� 243
17.5 Multiple Plots������������������������������������������������������������������������������������������������������� 266
17.6 Three-Dimensional Graphs����������������������������������������������������������������������������������� 272
References������������������������������������������������������������������������������������������������������������������� 277

■Chapter 18: High-Performance Computing�������������������������������������������������������� 279
18.1 Data���������������������������������������������������������������������������������������������������������������������� 279
18.2 Parallel Processing����������������������������������������������������������������������������������������������� 293
18.2.1 Other Parallel Processing Approaches������������������������������������������������������������������������������������� 296

References������������������������������������������������������������������������������������������������������������������� 301

■Chapter 19: Text Mining������������������������������������������������������������������������������������ 303
19.1 Installing Needed Packages and Software����������������������������������������������������������� 304
19.1.1 Java����������������������������������������������������������������������������������������������������������������������������������������� 304
19.1.2 PDF Software��������������������������������������������������������������������������������������������������������������������������� 305
19.1.3 R Packages������������������������������������������������������������������������������������������������������������������������������ 305
19.1.4 Some Needed Files������������������������������������������������������������������������������������������������������������������ 305

19.2 Text Mining����������������������������������������������������������������������������������������������������������� 306


19.2.1 Word Clouds and Transformations������������������������������������������������������������������������������������������� 307
19.2.2 PDF Text Input�������������������������������������������������������������������������������������������������������������������������� 311
19.2.3 Google News Input������������������������������������������������������������������������������������������������������������������ 312
19.2.4 Topic Models���������������������������������������������������������������������������������������������������������������������������� 313

19.3 Final Thoughts������������������������������������������������������������������������������������������������������ 320


References������������������������������������������������������������������������������������������������������������������� 320

Index��������������������������������������������������������������������������������������������������������������������� 321

xiii
About the Author

Joshua Wiley is a research fellow at the Mary MacKillop Institute for


Health Research at the Australian Catholic University and a senior partner
at Elkhart Group Limited, a statistical consultancy. He earned his Ph.D.
from the University of California, Los Angeles. His research focuses
on using advanced quantitative methods to understand the complex
interplays of psychological, social, and physiological processes in relation
to psychological and physical health. In statistics and data science, Joshua
focuses on biostatistics and is interested in reproducible research and
graphical displays of data and statistical models. Through consulting
at Elkhart Group Limited and his former work at the UCLA Statistical
Consulting Group, Joshua has supported a wide array of clients ranging
from graduate students to experienced researchers and biotechnology
companies. He also develops or co-develops a number of R packages
including varian, a package to conduct Bayesian scale-location structural
equation models, and MplusAutomation, a popular package that links R to
the commercial Mplus software.

xv
In Memoriam

Larry Pace was a statistics author, educator, and consultant. He lived in


the upstate area of South Carolina in the town of Anderson. He earned his
Ph.D. from the University of Georgia in psychometrics (applied statistics)
with a content major in industrial-organizational psychology. He wrote
more than 100 publications including books, articles, chapters, and book
and test reviews. In addition to a 35-year academic career, Larry worked in
private industry as a personnel psychologist and organization effectiveness
manager for Xerox Corporation, and as an organization development
consultant for a private consulting firm. He programmed in a variety of
languages and scripting languages including FORTRAN-IV, BASIC, APL,
C++, JavaScript, Visual Basic, PHP, and ASP. Larry won numerous awards
for teaching, research, and service. When he passed, he was a Graduate
Research Professor at Keiser University, where he taught doctoral courses
in statistics and research. He also taught adjunct classes for Clemson
University. Larry and his wife, Shirley, were volunteers with Meals on
Wheels and avid pet lovers—six cats and one dog, all rescued.
Larry wrote the first edition of Beginning R, as well as the beginning chapters of this second edition. He
passed away on April 8, 2015.
Larry was married to Shirley Pace. He also leaves four grown children and two grandsons.

xvii
About the Technical Reviewer

Sarah Stowell is a contract statistician based in the UK. Previously, she


has worked with Mitsubishi Pharma Europe, MDSL International, and
GlaxoSmithKline. She holds a master of science degree in statistics.

xix
Acknowledgments

I would like to acknowledge my coauthor, Larry Pace. This book would never have been without him, and
my heart goes out to his family and friends.
I would also like to thank my brother, Matt, who spent many hours reading drafts and discussing how
best to convey the ideas. When I needed an opinion about how to phrase something, he unflinchingly
brought several ideas to the table (sometimes too many).

xxi
Introduction

This book is about the R programming language. Maybe more important, this book is for you.
These days, R is an impressively robust language for solving problems that lend themselves to statistical
programming methods. There is a large community of users and developers of this language, and together
we are able to accomplish things that were not possible before we virtually met.
Of course, to leverage this collective knowledge, we have to start somewhere. Chapters 1 through 5
focus on gaining familiarity with the R language itself. If you have prior experience in programming, these
chapters will be very easy for you. If you have no prior programming experience, that is perfectly fine.
We build from the ground up, and let us suggest you spend some thoughtful time here. Thinking like a
programmer has some very great advantages. It is a skill we would want you to have, and this book is,
after all, for you.
Chapters 6 through 10 focus on what might be termed elementary statistical methods in R. We did not
have the space to introduce those methods in their entirety—we are supposing some knowledge of statistics.
An introductory or elementary course for nonmajors would be more than enough. If you are already familiar
with programming and statistics, we suggest you travel through these chapters only briefly.
With Chapter 11, we break into the last part of the book. For someone with both a fair grasp of traditional
statistics and some programming experience, this may well be a good place to start. For our readers who
read through from the first pages, this is where it starts to get very exciting. From bootstrapping to logistic
regression to data visualization to high-performance computing, these last chapters have hands-on examples
that work through some much applied and very interesting examples.
One final note: While we wrote this text from Chapter 1 to Chapter 19 in order, the chapters are fairly
independent of each other. Don't be shy about skipping to the chapter you're most interested in learning.
We show all our code, and you may well be able to modify what we have to work with what you have.
Happy reading!

xxiii
Chapter 1

Getting Star ted

There are compelling reasons to use R. Enthusiastic users, programmers, and contributors support R and its
development. A dedicated core team of R experts maintains the language. R is accurate, produces excellent
graphics, has a variety of built-in functions, and is both a functional language and an object-oriented one.
There are (literally) thousands of contributed packages available to R users for specialized data analyses.
Developing from a novice into a more competent user of R may take as little as three months by only
using R on a part-time basis (disclaimer: n = 1). Realistically, depending on background, your development
may take days, weeks, months, or even a few years, depending on how often you use R and how quickly
you can learn its many intricacies. R users often develop into R programmers who write R functions, and R
programmers sometimes want to develop into R contributors, who write packages that help others with
their data analysis needs. You can stop anywhere on that journey you like, but if you finish this book and
follow good advice, you will be a competent R user who is ready to develop into a serious R programmer if
you want to do it. We wish you the best of luck!

1.1 What is R, Anyway?


R is an open-source implementation of the S language created and developed at Bell Labs. S is also the basis
of the commercial statistics program S-PLUS, but R has eclipsed S-PLUS in popularity. If you do not already
have R on your system, the quickest way to get it is to visit the CRAN (Comprehensive R Network Archive)
website and download and install the precompiled binary files for your operating system. R works on
Windows, Mac OS, and Linux systems. If you use Linux, you may already have R with your Linux distribution.
Open your terminal and type $ R --version. If you do not already have R, the CRAN website is located at
the following URL:

http://cran.r-project.org/

Download and install the R binaries for your operating system, accepting all the defaults. At this writing,
the current version of R is 3.2.0, and in this book, you will see screenshots of R working in both Windows 7
and Windows 8.1. Your authors run on 64-bit operating systems, so you will see that information displayed
in the screen captures in this book. Because not everything R does in Unix-based systems can be done in
Windows, I often switch to Ubuntu to do those things, but we will discuss only the Windows applications
here, and leave you to experiment with Ubuntu or other flavors of Unix. One author runs Ubuntu on the
Amazon Cloud, but that is way beyond our current needs.
Go ahead and download Rstudio (current version as of this writing is 0.98.1103) now too, again,
accepting all defaults from the following URL:

http://www.rstudio.com/products/rstudio/download/

1
Chapter 1 ■ Getting Star ted

Rstudio is a very forgiving environment for the novice user, and code written in here will work just as
well in R itself.
Launch Rstudio and examine the resulting interface. Make sure that you can identify the following
parts of the R interface shown in Figure 1-1: the menu bar, the script editing area, the R console, and the
R command prompt, which is >.

Figure 1-1. The R console running in Rstudio

Before we continue our first R session, let’s have a brief discussion of how R works. R is a high-level
vectorized computer language and statistical computing environment. You can write your own R code, use
R code written by others, and use R packages you write and those written by you or by others. You can use R
in batch mode, terminal mode, in the R graphical user interface (RGui), or in Rstudio, which is what we will
do in this book. As you learn more about R and how to use it effectively, you will find that you can integrate R
with other languages such as Python or C++, and even with other statistical programs such as SPSS.
In some computer languages, for instance, C++, you have to declare a data type before you assign a
value to a new variable, but that is not true in R. In R, you simply assign a value to the object, and you can
change the value or the data type by assigning a new one. There are two basic assignment operators in R.
The first is < −, a left-pointing assignment operator produced by a less than sign followed by a “minus” sign,
which is really a hyphen. You can also use an equals sign = for assignments in R. I prefer the < − assignment
operator, and will use it throughout this book.
You must use the = sign to assign the parameters in R functions, as you will learn. R is not sensitive to
white space the way some languages are, and the readability of R code is benefited from extra spacing and
indentation, although these are not mandatory. R is, however, case-sensitive, so to R, the variables x and X
are two different things. There are some reserved names in R, which I will tell you about in Chapter 5.
The best way to learn R is to use R, and there are many books, web-based tutorials, R blog sites, and
videos to help you with virtually any question you might have. We will begin with the basics in this book but
will quickly progress to the point that you are ready to become a purposeful R programmer, as mentioned
earlier.

2
Chapter 1 ■ Getting Star ted

Let us complete a five-minute session in R, and then delve into more detail about what we did, and
what R was doing behind the scenes. The most basic use of R is as a command-line interpreted language.
You type a command or statement after the R prompt and then press <Enter>, and R attempts to implement
the command. If R can do what you are asking, it will do it and return the result in the R console. If R
cannot do what you are asking, it will return an error message. Sometimes R will do something but give you
warnings, which are messages concerning what you have done and what the impact might be, but that are
sometimes warnings that what you did was not what you probably wanted to do. Always remember that R,
like any other computer language, cannot think for you.

1.2 A First R Session


Okay, let’s get started. In the R console, type <Ctrl> + L to clear the console in order to have a little more
working room. Then type the following, pressing the <Enter> key at the end of each command you type.
When you get to the personal information, substitute your own data for mine:

> 1 + 1
[ 1 ] 2
> 1 ^ 1
[ 1 ] 1
> 1 * 1
[ 1 ] 1
> 1 - 1
[ 1 ] 0
> 1 : 1 0
[ 1 ] 1 2 3 4 5 6 7 8 9 1 0
> ( 1 : 1 0 ) ^ 2
[ 1 ] 1 4 9 1 6 2 5 3 6 4 9 6 4 8 1 1 0 0
> myName <- "Joshua Wiley"
> myAlmaMater <- "University of California, Los Angeles"
> myURL <- "www.JoshuaWiley.com"
> myPhone <- "1.260.673.5518"
> myData <- list(myName, myAlmaMater, myURL, myPhone)
> myData
[[1]]
[1] "Joshua Wiley"

[[2]]
[1] "University of California, Los Angeles"

[[3]]
[1] "www.JoshuaWiley.com"

[[4]]
[1] "1.260.673.5518"

We began with the use of R as a basic calculator. We can create sequences of integers by using the colon
operator. Using the exponentiation operator (1:10) ˆ2 gives us the squares of all the numbers in the vector
1 to 10. Observe that when you type a command and press the <Enter> key, R will return the result on the
next line, prefaced by an index, such as [1]. You can assign values to variables without declaring the variable
type, as we discussed, so you can just type myName < − "Joshua Wiley" to give the variable a value.

3
Chapter 1 ■ Getting Star ted

This might have seemed a strange way to start, but it shows you some of the things you can enter into
your R workspace simply by assigning them. Character strings must be enclosed in quotation marks, and
you can use either single or double quotes. Numbers can be assigned as they were with the myPhone variable.
With the name and address, we created a list, with is one of the basic data structures in R. Unlike vectors,
lists can contain multiple data types. We also see square brackets [ and ], which are R’s way to index the
elements of a data object, in this case our list. We can also create vectors, matrices, and data frames in R.
Let’s see how to save a vector of the numbers from 1 to 10. We will call the vector x. We will also create a
“constant” called y:

> x < - 1 : 1 0
> x
[ 1 ] 1 2 3 4 5 6 7 8 9 1 0
> y < - 5
> y
[ 1 ] 5

See that R starts its listing of both x and y with an index [1]. This is because R does not recognize a
scalar value. To R, even a single number is a vector. The object y is a vector with one element. The [1] in
front of x means that the first element of the vector appears at the beginning of the line. Let’s make another
vector, z, containing a sequence of 33 randomly generated numbers from a normal distribution with a mean
of 70 and a standard deviation of 10. Because the numbers are random, your z vector will not be the same as
mine, though if we wanted to, we could set the seed number in R so that we would both get the same vector:

> z < - r n o r m ( 3 3 , 70 , 1 0 )
> z < - r o u n d ( z , 2 )
> z
[ 1 ] 8 1 . 5 6 7 0 . 8 5 7 7 . 4 8 6 4 . 0 2 6 8 . 9 4 8 0 . 2 4 6 0 . 8 4
7 0 . 9 3 7 5 . 2 1 7 5 . 0 5 5 2 . 1 7 5 2 . 2 9
[ 1 3 ] 7 0 . 2 0 7 9 . 2 9 8 4 . 7 5 6 4 . 8 8 7 3 . 7 4 7 1 . 1 9 6 1 . 0 1
6 3 . 4 3 5 5 . 7 4 7 1 . 5 4 6 9 . 7 1 8 2 . 5 2
[ 2 5 ] 7 3 . 4 0 7 5 . 3 9 7 9 . 2 8 8 0 . 3 6 6 5 . 7 9 7 3 . 1 5 7 5 . 4 1
6 9 . 5 6 8 5 . 8 7

When R must wrap to a new line in the console to print additional output, it shows the index of the first
element of each line.
To see a list of all the objects in your R session, type the command ls():

> ls()
[1] "myAlmaMater" "myData" "myName" "myPhone" "myURL" "x" "y" "z"

To see the current working directory, type the command getwd(). You can change the working directory
by typing setwd(), but I usually find it easier to use the File menu. Just select File > Change dir... and
navigate to the directory you want to become the new working directory. As you can see from the code listing
here, the authors prefer working in the cloud. This allows us to gain access to our files from any Internet-
connected computer, tablet, or smartphone. Similarly, our R session is saved to the cloud, allowing access
from any of several computers at home or office computers.

> getwd()
[1] "C:/Users/Joshua Wiley/Google Drive/Projects/Books/Apress_BeginningR/BeginningR"

4
Chapter 1 ■ Getting Star ted

In addition to ls(), another helpful function is dir(), which will give you a list of the files in your current
working directory.
To quit your R session, simply type q() at the command prompt, or if you like to use the mouse, select
File > Exit or simply close Rstudio by clicking on the X in the upper right corner. In any of these cases, you
will be prompted to save your R workspace.
Go ahead and quit the current R session, and save your workspace when prompted. We will come
back to the same session in a few minutes. What was going on in the background while we played with R
was that R was recording everything you typed in the console and everything it wrote back to the console.
This is saved in an R history file. When you save your R session in an RData file, it contains this particular
workspace. When you find that file and open it, your previous workspace will be restored. This will keep you
from having to reenter your variables, data, and functions.
Before we go back to our R session, let’s see how to use R for some mathematical operators and
functions (see Table 1-1). These operators are vectorized, so they will apply to either single numbers or
vectors with more than one number, as we will discuss in more detail later in this chapter. According to the
R documentation, these are “unary and binary generic functions” that operate on numeric and complex
vectors, or vectors that can be coerced to numbers. For example, logical vectors of TRUE and FALSE are
coerced to integer vectors, with TRUE = 1 and FALSE = 0.

Table 1-1. R’s mathematical operators and functions

Operator/Function R Expression Code Example


Addition + 2+2
Subtraction − 3-2
Multiplication * 2*5
Division / 4/2
Exponent ˆ 3ˆ2
Square Root sqrt( ) sqrt(81)
Natural Logarithm log( ) log(10)
Modulus %% x%%y
Absolute Value abs( ) abs(-3)

Table 1-2 shows R’s comparison operators. Each of these evaluates to a logical result of TRUE or FALSE.
We can abbreviate TRUE and FALSE as T and F, so it would be unwise to name a variable T or F, although R will
let you do that. Note that the equality operator == is different from the = used as an assignment operator. As
with the mathematical operators and the logical operators (see Chapter 4), these are also vectorized.

Table 1-2. Comparison operators in R

Operator R Expression Code Example


Equality == x == 3
Inequality != x != 4
Greater than > 5>3
Less than < 3<5
Greater than or equal to >= 3 >= 1
Less than or equal to <= 3 <= 3

5
Chapter 1 ■ Getting Star ted

R has six “atomic” vector types (meaning that they cannot be broken down any further), including
logical, integer, real, complex, string (or character), and raw. Vectors must contain only one type of
data, but lists can contain any combination of data types. A data frame is a special kind of list and the most
common data object for statistical analysis. Like any list, a data frame can contain both numerical and
character information. Some character information can be used for factors. Working with factors can be a
bit tricky because they are “like” vectors to some extent, but they are not exactly vectors.
My friends who are programmers who dabble in statistics think factors are evil, while statisticians like
me who dabble in programming love the fact that character strings can be used as factors in R, because
such factors communicate group membership directly rather than indirectly. It makes more sense to have
a column in a data frame labeled sex with two entries, male and female, than it does to have a column
labeled sex with 0s and 1s in the data frame. If you like using 1s and 0s for factors, then use a scheme such as
labeling the column female and entering a 1 for a woman and 0 for a man. That way the 1 conveys meaning,
as does the 0. Note that some statistical software programs such as SPSS do not uniformly support the use of
strings as factors, whereas others, for example, Minitab, do.
In addition to vectors, lists, and data frames, R has language objects including calls, expressions, and
names. There are symbol objects and function objects, as well as expression objects. There is also a special
object called NULL, which is used to indicate that an object is absent. Missing data in R are indicated by NA,
which is also a valid logical object.

1.3 Your Second R Session


Reopen your saved R session by navigating to the saved workspace and launching it in R. We will put R
through some more paces now that you have a better understanding of its data types and its operators,
functions, and “constants.” If you did not save the session previously, you can just start over and type in the
missing information again. You will not need the list with your name and data, but you will need the x, y, and
z variables we created earlier.
As you have learned, R treats a single number as a vector of length 1. If you create a vector of two or
more objects, the vector must contain only a single data type. If you try to make a vector with multiple data
types, R will coerce the vector into a single type.

1.3.1 Working with Indexes


R’s indexing is quite flexible. We can use it to add elements to a vector, to substitute new values for old ones,
and to delete elements of the vector. We can also subset a vector by using a range of indexes. As an example,
let’s return to our x vector and make some adjustments:

> x
[ 1 ] 1 2 3 4 5 6 7 8 9 1 0
> x [ 1 ]
[ 1 ] 1
> x [ 2 : 4 ]
[ 1 ] 2 3 4
> x [ - 1 0 ]
[ 1 ] 1 2 3 4 5 6 7 8 9
> x
[ 1 ] 1 2 3 4 5 6 7 8 9 1 0
> x [ 2 : 4 ] < - c ( 9 8 , 99 , 1 0 0 )
> x
[ 1 ] 1 9 8 9 9 1 0 0 5 6 7 8 9 1 0

6
Chapter 1 ■ Getting Star ted

Note that if you simply ask for subsets, the x vector is not changed, but if you reassign the subset or
modified vector, the changes are saved. Observe that the negative index removes the selected element
or elements from the vector but only changes the vector if you reassign the new vector to x. We can, if we
choose, give names to the elements of a vector, as this example shows:

> x < - 1 : 1 0
> x
[ 1 ] 1 2 3 4 5 6 7 8 9 1 0
> n a m e s ( x ) < - c ( " A " , " B " , " C " , " D " , " E " , " F " , " G " , " H " , "
I " , " J " )
> x
A B C D E F G H I J
1 2 3 4 5 6 7 8 9 1 0

This showcases the difference between thinking as a user versus thinking as a programmer! R has a
variety of built-in functions that automate even the simplest kind of operations. You just saw me waste
our time by typing in the letters A through J. R already knows the alphabet, and all you have to do is tell
R you want the first 10 letters. The more you know about R, the easier it is to work with, because it keeps
you from having to do a great deal of repetition in your programming. Take a look at what happens when
we ask R for the letters of the alphabet and use the power of built-in character manipulation functions to
make something a reproducible snippet of code. Everyone starts as an R user and (ideally) becomes an R
programmer, as discussed in the introduction:

> x
[ 1 ] 1 2 3 4 5 6 7 8 9 1 0
> n a m e s ( x ) < - t o u p p e r ( l e t t e r s [ 1 : 1 0 ] )
> x
A B C D E F G H I J
1 2 3 4 5 6 7 8 9 1 0

The toupper function coerces the letters to uppercase, and the letters[1:10] subset gives us A
through J. Always think like a programmer rather than a user. If you wonder if something is possible,
someone else has probably thought the same thing. Over two million people are using R right now, and
many of those people write R functions and code that automates the things that we use on such a regular
basis that we usually don’t even have to wonder whether but simply need to ask where they are and how to
use them. You can find many examples of efficient R code on the web, and the discussions on StackExchange
are very helpful.
If you are trying to figure something out that you don’t know how to do, don’t waste much time
experimenting. Use a web search engine, and you are very likely to find that someone else has already found
the solution, and has posted a helpful example you can use or modify for your own problem. The R manual
is also helpful, but only if you already have a strong programming background. Otherwise, it reads pretty
much like a technical manual on your new toaster written in a foreign language.
It is better to develop good habits in the beginning than it is to develop bad habits and then having to
break them first before you can learn good ones. This is what Dr. Lynda McCalman calls a BFO. That means a
blinding flash of the obvious. I have had many of those in my experience with R.

1.3.2 Representing Missing Data in R


Now let’s see how R handles missing data. Create a simple vector using the c() function (some people say
it means combine, while others say it means concatenate ). I prefer combine because there is also a cat()
function for concatenating output. For now, just type in the following and observe the results. The built-in

7
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of How to Get
Rich
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: How to Get Rich

Author: Anonymous

Release date: May 11, 2021 [eBook #65322]

Language: English

Credits: Demian Katz, Craig Kirkwood, and the Online


Distributed Proofreading Team at
https://www.pgdp.net (Images courtesy of the Digital
Library@Villanova University)

*** START OF THE PROJECT GUTENBERG EBOOK HOW TO GET


RICH ***
Multum in Parvo
Library.
Entered at Post Office as Second-Class matter.

Vol. I. August, 1894. No. 8.


Published Monthly.

How
To Get Rich.
Smallest Magazine in the World. Subscription
price, 50 cts. per year. Single copies, 5 cents
each.

PUBLISHED BY
A. B. COURTNEY,
671 Tremont Street, Boston.
HOW TO GET RICH.
Valuable Money-Making Secrets.
These recipes have sold for five dollars
each, and have been the foundations of
many good-sized fortunes.

This collection of recipes and formulas for making various articles


which are in constant use in every household are, for the most part,
articles upon which very large profits are made, both by
manufacturers and dealers; some things, which cost but two or
three cents to make, being retailed for as much as twenty-five cents.
We point out to you the proper method to be pursued in the
manufacture of these various articles, and expect you to use your
own judgment and discretion in the matter of putting them up for
market, and exposing them for sale. The goods, when ready for
market, may be sold either direct to consumers at retail, or to store-
keepers at wholesale. Those who adopt the former method may
canvass from house to house, or establish a store and sell
therefrom. The various ingredients required to compound all the
different articles for which recipes are here given may be purchased
at wholesale drug and grocery stores in any of the large cities. Large
fortunes have been made upon the manufacture of single articles,
for which recipes are here given, and there is no reason why any
one may not acquire a competency in the same way, providing he
has the necessary push and sagacity. Here is an opportunity to be
your own manufacturer, your own wholesaler and your own retailer.
Given these advantages, you may undersell those in the ordinary
channels of trade, and still make handsome profits; and we trust
that the information herein contained may be the means of starting
many a poor person toward making a fortune or a good income.
Black Ink.—Ink, like soap, is something everybody uses, and few
people realize that thousands of barrels of it are made and sold.
Recipe for making the best and most durable black writing ink, as
used by the leading penmen of the United States and Canada.
To 2 gallons of strong decoction of logwood, well strained, add 1 1/2
lbs. blue galls in coarse powder, 6 ounces sulphate of iron, 1 oz.
acetate of copper, 6 oz. of pulverized sugar, and 8 oz. of gum arabic;
set the above on the fire until it begins to boil, strain, and then set it
away until it has acquired the desired blackness. The strong
“decoction of logwood” is made by boiling; use soft water, into which
put two ounces of logwood; strain after taking from the fire.
The above ink properly made, according to the above directions, is
unsurpassed for elegant writing of any kind. It flows freely from the
pen, turns to a deep black after writing, and does not fade. Records
written with it fifty years ago are as legible as the day they were put
upon the paper.
Fig Candy.—Take 1 pound of sugar and 1 pint of water; set over a
slow fire. When done, add a few drops of vinegar and a lump of
butter, and pour into pans in which split figs are laid.
Red Sealing Wax.—Purchase 4 lbs. shellac, 1 1/2 lbs. venice
turpentine, 3 lbs. finest cinnabar and 4 oz. venetian; mix the whole
well together, and melt over a very slow fire. Pour it on a thick,
smooth glass, or any other flat, smooth surface, and make it into 3,
6 or 10 sticks.
Silver Ink.—Mix 1 oz. of the finest pewter or block tin in shavings
with 2 oz. quicksilver till all becomes fluid; then add to it sufficient
gum arabic water to produce the proper consistency.
Yellow Ink.—A little alum added to saffron, in soft, hot water, makes
a beautiful yellow ink.
Mucilage for Labels.—Dextrine, 2 ounces; glycerine, 1 drachm;
alcohol, 1 ounce; water, 6 ounces.
The Celebrated Chemical Compound.—Take one pint of alcohol, 2
gills nitrous spirits ether, 2 oz. bicromate potash, 2 oz. powdered
cinnamon, 2 oz. aqua fortis. Mix all the above together and let it
stand twenty-four hours and it is fit for use. Bottle in ounce vials,
and sell for 25 cents. To extract grease stains, etc., from cloth,
saturate with cold water, dip a sponge in the liquid and apply it, and
repeat if necessary, and wash off with cold water.
Gold Ink.—Two parts mosaic, 1 part gum arabic (by measure); mix
with soft water until reduced to a proper condition.
Green Ink.—Powder 1 ounce verdigris, and put it in 1 quart of
vinegar; after it has stood two or three days, strain off the liquid.
Blue Ink.—Two oz. Chinese blue, 3/4 oz. pure oxolid acid, 1 oz.
powdered gum arabic, 6 pints distilled soft water; mix well and then
strain.
Purple Ink.—Eight parts logwood in 64 parts soft water, by measure,
boil down to one-half, then strain and add one part chloride of tin.
Imitation Gold.—Sixteen parts platina, seven parts copper, one part
zinc. Put in a covered crucible, with powdered charcoal, and melt
together till the whole forms one mass, and are thoroughly
incorporated together. Or, take 4 oz. platina, 3 oz. silver, 1 oz.
copper.
Imitation Silver.—Eleven ounces refined nickel, two ounces metallic
bismuth. Melt the compositions together three times, and pour them
out in ley. The third time, when melting, add two ounces pure silver.
Or take one-quarter ounce copper, one ounce bismuth, two ounces
saltpetre, two ounces common salt, one ounce arsenic, one ounce
potash, two ounces brass, and three ounces pure silver. Melt all
together in a crucible.
Florida Water.—Half pint proof spirits, two drachms oil lemon, half
drachm oil rosemary. Mix.
Freckle Lotion.—Muriate of ammonia, one drachm; cologne water,
two drachms; distilled water, seven ounces; mix and use as a wash.
It contains nothing injurious.
Windsor Soap.—This is made with lard. In France they use lard, with
a portion of olive or bleached palm oil. It is made with one part of
olive oil to nine of tallow; but a greater part of what is sold is only
curd (tallow) soap, and scented with oil of caraway and bergamot.
The brown is colored with burnt sugar or umber.
To Make Maple Sugar without Maple Trees.—Though the secret I am
about to reveal may seem very simple (when explained), I believe
there are few who would discover it of their own accord. The value
of the maple sugar crop is considerable, and there is ready sale for
all that can be made. I was led by curiosity to boil down a little
butternut sap, one time, with an equal quantity of maple sap, and
the result was, a sugar which I could not distinguish from pure
maple. I experimented further and found that if a little common
(cane) sugar was added to the sap of the butternut, it would do as
well as an addition of maple sap. I found that the sap of birch and
several other trees would also make, when a very little cane sugar
was added, a sugar which in looks and taste exactly resembled
maple. To be able to make “maple” sugar from trees not heretofore
deemed valuable for the purpose is just so much clear profit.
Traveller’s Ink.—White blotting paper is saturated with aniline black,
and several sheets are pasted together so as to form a thick pad.
When required for use a small piece is torn off and covered with a
little water. The black liquid which dissolves out is a good writing ink.
A square inch of paper will produce enough ink to last a considerable
writing, and a few pads would be all that an exploring party need
carry with them. As water is always available the ink is readily made.
This is a perfectly original and new recipe. Any enterprising man can
make a large income out of its manufacture.
Violet Ink.—1 oz. best violet aniline; dissolve it in one gill of hot
alcohol, stir, and when thoroughly dissolved add one gallon of boiling
hot water; dissolve in the hot water 1 1/2 oz. white gum arabic. This
will make the most rich and beautiful ink of this color in existence;
will not fade or corrode steel pens, and is not injured by freezing. An
addition of 1 lb. of sugar and 1/2 lb. glycerine will make an excellent
copying ink. This ink is usually sold at $2 per pint bottle, $1 for half
pint and 50 cents for gill bottle. It is worth an enterprising man or
woman $1,000. Do not bury it—use it and make money out of it.
New York Barber’s Star Hair Oil.—Castor oil, 6 1/2 pints, alcohol, 1 1/2
pints, oil of citronella, 1/2 ounce, lavender, 1/4 ounce. Mix well, put in
4-ounce bottles; retail at 25 cents each.
Furniture Polish.—Equal parts sweet oil and vinegar, and a pint of
gum arabic finely powdered. Shake the bottle and apply with a rag.
It will make furniture look as good as new.
Artificial Gold.—This is a new metallic alloy which is now very
extensively used in France as a substitute for gold. Pure copper, one
hundred parts; zinc, or, preferably, tin, seventeen parts; magnesia,
six parts; sal-ammoniac, three-sixths parts; quick-lime, one-eighth
part; tartar of commerce, nine parts, are mixed as follows: The
copper is first melted, and the magnesia, sal-ammoniac, lime and
tartar are then added separately, and by degrees, in the form of
powder; the whole is now briskly stirred for about half an hour, so as
to mix thoroughly; and when the zinc is added in small grains by
throwing it on the surface, and stirring till it is entirely fused, the
crucible is then covered, and the fusion maintained for about thirty-
five minutes. The surface is then skimmed, and the alloy is ready for
casting. It has a fine grain, is malleable, and takes a splendid polish.
It does not corrode readily, and for many purposes is an excellent
substitute for gold. When tarnished, its brilliancy can be restored by
a little acidulated water. If tin be employed instead of zinc, the alloy
will be more brilliant. It is very much used in France, and must
ultimately attain equal popularity here.
Baking Powder.—The following receipt is the same as used in the
preparation of the standard baking powders of the day, and if put up
attractively will sell readily at the usual prices. Take 1 pound of
tartaric acid in crystals, 1 1/2 pounds of bi-carbonate of soda and
1 1/2 pounds of potato starch. Each must be powdered separately,
well dried by slow heat, well mixed through a sieve. Pack hard in
tinfoil, tin or paper glazed on the outside. The tartaric acid and bi-
carbonate of soda can, of course, be bought cheaper of wholesale
druggists than you can make them, unless you are doing things on a
very large scale, but potato starch any one can make; it is only
necessary to peel the potatoes and to grate them up fine into
vessels of water, to let them settle, pour off the water and make the
settlings into balls, and to dry them. With these directions any one
can make as good a baking powder as is sold anywhere; if he wants
to make it very cheap, he can take cream of tartar and common
washing (carbonate of) soda, instead of the articles named in the
recipe, but this would be advisable only where customers insist on
excessively low prices in preference to quality of goods.
Babbit’s Premium Soap.—Five gallons of strong lye, five gallons of
water, five pounds of tallow, two pounds of sal soda, half a pound of
rosin, one pint salt, one pint washing fluid. Let this water boil, then
put in the articles, and boil half an hour. Stir it well while boiling, and
then run it into moulds: it will be ready for use as soon as cold. The
above is for 100 pounds of soap.
Royal Washing Powder.—Mix any quantity of soda ash with an equal
quantity of carbonate of soda—ordinary soda—crushed into coarse
grains. Have a thin solution of glue, or decoction of linseed oil ready,
into which pour the soda until quite thick. Spread it out on boards in
a warm apartment to dry. As soon as dry shake up well so that it will
pack easily into nice, square packages. Label neatly. Pound packages
cost 7 cents, retail for 25 cents.
Patent Starch Polish.—Take common dry potato or wheat starch,
sufficient to make a pint of starch when boiled. When boiled add
one-half drachm spermaceti, and one-half drachm of white wax,
then use it as common starch, only using the iron as hot as possible.
Invisible Ink.—Sulphuric acid 1 part, water 20 parts; mix together
and write with a quill pen, which writing can only be read after
heating it.
Fine Peppermint Lozenges.—Best powdered white sugar, 7 pounds;
pure starch, 1 pound; oil of peppermint to flavor. Mix with mucilage.
India Ink.—Ivory black ground into powder, make into a paste with a
few drops of essence of musk, and one half as much essence of
ambergris, and then form into cakes.
To Preserve Flowers in Water.—Mix a little carbonate of soda in the
water, and it will keep the flowers a fortnight.
Ginger Lozenges.—Mix with the white of eggs four ounces of
powdered ginger, two pounds of white sugar, and one pound of
starch.
To Restore the Color of Black Kid Boots.—Take a small quantity of
good black ink, mix it with the white of an egg, and apply it to the
boots with a soft sponge.
Color for Wicker Baskets, or any small Articles of the Kind.—Dissolve
one stick of black sealing-wax and one stick of red in two ounces of
spirits of wine. Lay it on with a small brush.
To Remove Stains from Books.—To remove ink-spots, apply a
solution of oxalic, citric, or tartaric acid. To remove spots of grease,
wax, oil, or fat, wash the injured part with either, and place it
between white blotting-paper. Then, with a hot iron, press above the
part stained.
To Clean Black Veils.—Pass them through a warm liquor of bullock’s
gall and water; rinse in cold water; then take a small piece of glue,
pour boiling water on it, and pass the veil through it; clap it, and
frame to dry. Instead of framing, it may be fastened with drawing-
pins closely fixed upon a very clean paste or drawing-board.
To Clean a Marble Chimney Piece.—If the marble is white, procure
half a pound of pearlash, one pound of whiting, and half a pound of
soft soap; boil all these ingredients together until they attain the
consistence of a thick paste. When nearly cold, lay it upon the
marble, and let it remain on it for at least twenty-four hours. Wash it
off with soft water, and polish with linen rags. Spirits of turpentine is
excellent for cleaning black marble.
Oil Stains in Silk and other Fabrics.—Benzine is most effectual, not
only for silk, but for any other material whatever. It can be procured
from any druggist. By simply covering both sides of greased silk with
magnesia, and allowing it to remain for a few hours, the oil is
absorbed by the powder. Should the first application be insufficient,
it may be repeated, and even rubbed in with the hand. Should the
silk be Tussah or Indian silk, it will wash.
Scarlet Ink.—Dissolve 1 oz. garancine of the best quality in 1 oz.
liquor ammonia; add 1 pint soft cold water distilled; mix together in
a mortar, filter and dissolve in it 1/2 oz. of gum arabic.
Luminous Ink.—Shines in the dark—Phosphorous, one-half drachm,
oil cinnamon, one-half oz., mix in a vial, cork tightly, heat it slowly
until mixed. A letter written with this ink can only be read in a dark
room, when the writing will have the appearance of fire.
Brown Ink.—Take 4 parts powdered catechu and put it in 6 parts soft
water; let it stand for half a day, shaking occasionally, then strain,
and to bring it to the proper consistency, add sufficient of a solution
of bichromate of potash, 1 part in 16 of water, all by measure.
Ink Powder.—One pound of nutgall, 7 ounces copperas, 7 ounces
gum arabic: this amount of ink powder will make one gallon of good
black ink; to prevent it from moulding, powder two or three cloves
and mix with each pound of powder.
Excelsior Hair Oil.—One gallon cologne spirits 90 per cent. proof, add
of the oil of lemon, orange and bergamot, each a spoonful, add also
of the extract of vanilla 40 drops, shake until the oils are cut up,
then add one and a half pints of soft water.
Commercial Writing Ink.—Galls, 1 ounce; gum, 1/2 ounce; cloves, 1/2
ounce; sulphate of iron, 1/2 ounce; water, 8 ounces. Digest by
frequent shaking until it has sufficient color. This is a good durable
ink and will bear diluting.
Indelible Ink.—For marking linen without preparation. Nitrate of
silver, 1 1/2 oz., dissolve in 6 oz. of liquor ammonia fortis, archil for
coloring, 1 oz. Gum mucilage, 12 ounces. The best extant.
Bristol’s Tooth Powder.—Prepared chalk, 1 pound; castile soap, 1/2
pound; powdered yellow bark, 2 ounces; powdered gum myrrh, 2
ounces; powdered loaf sugar, 2 ounces; powdered orris, 2 ounces.
Mix well, after having first pulverized the castile.
Cold Cream.—One pound of lard, three ounces of spermaceti. Melt
with a gentle heat, and when cooling stir in orange-flower water, one
ounce, essence of lavender, twenty-six drops.
To Make Paint for One Cent a Pound.—To one gallon of soft hot
water add four pounds sulphate of zinc (crude). Let it dissolve
perfectly, and a sediment will settle at the bottom. Turn the clear
solution into another vessel. To one gallon of paint (lead and oil),
mix one gallon of the compound. Stir into it the paint slowly for ten
or fifteen minutes, and the compound and the paint will perfectly
combine. If too thick, thin it with turpentine. This receipt has been
sold to painters as high as $100 for the privilege to use the same in
their business.
Almond Cream.—(There is nothing equal to this cream for softening
and whitening the hands.) Mix honey, almond meal and olive oil into
a paste to be used after washing with soap. Castile soap is best for
use; it will cure a scratch, or cut, and prevents any spot.
Cream of Roses.—Take one teacupful of rose water, as much sub-
carbonate of potash as will lie on a shilling, and half an ounce of oil
of sweet almonds. Let all be well shaken together until it becomes
thoroughly mixed, which will take some time. This is one of the best
face washes made, and is entirely harmless.
Excellent Pomade.—Three ounces of olive oil, three-quarters of a
drachm of the oil of almonds, two drachms of palm oil, half an ounce
of white wax, a quarter of a pound of lard, and three-quarters of a
drachm of the essence of bergamot. This pomade is excellent for
strengthening the hair, promoting the growth of whiskers and
moustaches, and preventing baldness.
Superior Cologne Water.—Alcohol, one gallon; add oil of cloves,
lemon, nutmeg and bergamot, each one drachm; oil neroli, three
and a half drachms; seven drops of oils of rosemary, lavender and
cassia; half a pint of spirits of nitre; half a pint of elder-flower water.
Let it stand a day or two, then take a colander and at the bottom lay
a piece of white cloth, and fill it up, one-fourth of white sand, and
filter through it.
Family Salve.—Take the root of the yellow dock and dandelion, equal
parts; add good proportion of celandine and plantain. Extract the
juices by steeping or pressing. Strain carefully, and simmer the liquid
with sweet cream or fresh butter and mutton tallow, or sweet oil and
mutton tallow. Simmer together until no appearance of the liquid
remains. Before it is quite cold, put it into boxes. This is one of the
most soothing and healing preparations for burns, scalds, cuts, and
sores of every description.
Japanese Cement.—Immediately mix the best powdered rice with a
little cold water, then gradually add boiling water until a proper
consistency is acquired, being particularly careful to keep it well
stirred all the time; lastly, it must be boiled for a minute in a clean
saucepan or earthern pipkin. This glue is beautifully white and
almost transparent, for which reason it is well adapted for fancy
paper work, which requires a strong and colorless cement.
Transcriber’s Note:
Use of - to represent division in some expressions is standardized to /.
*** END OF THE PROJECT GUTENBERG EBOOK HOW TO GET RICH
***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.

You might also like