Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Regression Analysis with R

You're reading from  Regression Analysis with R

Product type Book
Published in Jan 2018
Publisher Packt
ISBN-13 9781788627306
Pages 422 pages
Edition 1st Edition
Languages
Author (1):
Giuseppe Ciaburro Giuseppe Ciaburro
Profile icon Giuseppe Ciaburro

Table of Contents (15) Chapters

Title Page
Packt Upsell
Contributors
Preface
1. Getting Started with Regression 2. Basic Concepts – Simple Linear Regression 3. More Than Just One Predictor – MLR 4. When the Response Falls into Two Categories – Logistic Regression 5. Data Preparation Using R Tools 6. Avoiding Overfitting Problems - Achieving Generalization 7. Going Further with Regression Models 8. Beyond Linearity – When Curving Is Much Better 9. Regression Analysis in Practice 1. Other Books You May Enjoy Index

Creating a linear regression model


In the previous section, we adopted an algebraic approach to calculating the regression line. More generally, to create a linear regression model, we use the lm() function. This function creates a LinearModel object. The object of class lm has a series of properties that can be immediately viewed by simply clicking on it. These types of objects can be used for residual analysis and regression diagnosis. 

Note

LinearModel is an object comprised of data, model description, diagnostic information, and fitted coefficients for a linear regression.

Models for the lm() function are specified symbolically. In fact, the first argument of the function is an object of class formula. A typical formula object has the following form:

response ~ terms

response represents the (numeric) response vector and terms is a series of terms specifying a linear predictor for response. Let us take a look at a terms specification of the following form:

A + B

This indicates all the terms...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}