Regression Analysis with R
Giuseppe Ciaburro
- 422 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Regression Analysis with R
Giuseppe Ciaburro
About This Book
Build effective regression models in R to extract valuable insights from real data
Key Features
- Implement different regression analysis techniques to solve common problems in data science - from data exploration to dealing with missing values
- From Simple Linear Regression to Logistic Regression - this book covers all regression techniques and their implementation in R
- A complete guide to building effective regression models in R and interpreting results from them to make valuable predictions
Book Description
Regression analysis is a statistical process which enables prediction of relationships between variables. The predictions are based on the casual effect of one variable upon another. Regression techniques for modeling and analyzing are employed on large set of data in order to reveal hidden relationship among the variables.
This book will give you a rundown explaining what regression analysis is, explaining you the process from scratch. The first few chapters give an understanding of what the different types of learning are – supervised and unsupervised, how these learnings differ from each other. We then move to covering the supervised learning in details covering the various aspects of regression analysis. The outline of chapters are arranged in a way that gives a feel of all the steps covered in a data science process – loading the training dataset, handling missing values, EDA on the dataset, transformations and feature engineering, model building, assessing the model fitting and performance, and finally making predictions on unseen datasets. Each chapter starts with explaining the theoretical concepts and once the reader gets comfortable with the theory, we move to the practical examples to support the understanding. The practical examples are illustrated using R code including the different packages in R such as R Stats, Caret and so on. Each chapter is a mix of theory and practical examples.
By the end of this book you will know all the concepts and pain-points related to regression analysis, and you will be able to implement your learning in your projects.
What you will learn
- Get started with the journey of data science using Simple linear regression
- Deal with interaction, collinearity and other problems using multiple linear regression
- Understand diagnostics and what to do if the assumptions fail with proper analysis
- Load your dataset, treat missing values, and plot relationships with exploratory data analysis
- Develop a perfect model keeping overfitting, under-fitting, and cross-validation into consideration
- Deal with classification problems by applying Logistic regression
- Explore other regression techniques – Decision trees, Bagging, and Boosting techniques
- Learn by getting it all in action with the help of a real world case study.
Who this book is for
This book is intended for budding data scientists and data analysts who want to implement regression analysis techniques using R. If you are interested in statistics, data science, machine learning and wants to get an easy introduction to the topic, then this book is what you need! Basic understanding of statistics and math will help you to get the most out of the book. Some programming experience with R will also be helpful
Frequently asked questions
Information
Regression Analysis in Practice
- Random forest
- Logistic regression
- Neural network regression
Random forest regression with the Boston dataset
http://archive.ics.uci.edu/ml
- Number of instances: 506
- Number of attributes: 14 continuous attributes (including the class attribute medv), and one binary-valued attribute
- crim: Per capita crime rate by town
- zn: Proportion of residential land zoned for lots over 25,000 square feet
- indus: Proportion of non-retail business acres per town
- chas: Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)
- nox: Nitric oxides concentration (parts per ten million)
- rm: Average number of rooms per dwelling
- age: Proportion of owner-occupied units built prior to 1940
- dis: Weighted distances to five Boston employment centers
- rad: Index of accessibility to radial highways
- tax: Full-value property-tax rate per $10,000
- ptratio: Pupil-teacher ratio by town
- black: 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town
- lstat: Percent of the lower status of the population
- medv: Median value of owner-occupied homes in $1000
BHData <- read.table(url("https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data"), sep = "")
names(BHData)<- c("crim","zn","indus","chas","nox","rm",
"age","dis","rad","tax","ptratio","black","lstat","medv")
Exploratory analysis
str(BHData)
> str(BHData)
'data.frame': 506 obs. of 14 variables:
$ crim : num 0.00632 0.02731 0.02729 0.03237 0.06905 ...
$ zn : num 18 0 0 0 0 0 12.5 12.5 12.5 12.5 ...
$ indus : num 2.31 7.07 7.07 2.18 2.18 2.18 7.87 7.87 7.87 7.87
...
$ chas : int 0 0 0 0 0 0 0 0 0 0 ...
$ nox : num 0.538 0.469 0.469 0.458 0.458 0.4...