Book Image

R Statistical Application Development by Example Beginner's Guide

By : Prabhanjan Narayanachar Tattar
Book Image

R Statistical Application Development by Example Beginner's Guide

By: Prabhanjan Narayanachar Tattar

Overview of this book

<p>"R Statistical Application Development by Example Beginner’s Guide" explores statistical concepts and the R software, which are well integrated from the word go. This demarcates the separate learning of theory and applications and hence the title begins with “R Statistical …”. Almost every concept has an R code going with it which exemplifies the strength of R and applications. Thus, the reader first understands the data characteristics, descriptive statistics, and the exploratory attitude which gives the first firm footing of data analysis. Statistical inference and the use of simulation which makes use of the computational power complete the technical footing of statistical methods. Regression modeling, linear, logistic, and CART, builds the essential toolkit which helps the reader complete complex problems in the real world.<br /><br />The reader will begin with a brief understanding of the nature of data and end with modern and advanced statistical models like CART. Every step is taken with DATA and R code.<br /><br />The data analysis journey begins with exploratory analysis, which is more than simple descriptive data summaries, and then takes the traditional path up to linear regression modeling, and ends with logistic regression, CART, and spatial statistics.<br /><br />True to the title R Statistical Application Development by Example Beginner’s Guide, the reader will enjoy the examples and R software.</p>
Table of Contents (18 chapters)
R Statistical Application Development by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
References
Index

Time for action – building a multiple linear regression model


The method of building a multiple linear regression model remains the same as earlier. If all the variables in data.frame are to be used, we use the formula y ~ .. However, if we need specific variables, say x1 and x3, the formula would be y ~ x1 + x3.

  1. Build the multiple linear regression model with gasoline_lm <- lm(y~., data=Gasoline). Here, the formula y~. considers the variable y as the dependent variable and all the remaining variables in the Gasoline data frame as independent variables.

  2. Get the details of the fitted multiple linear regression model with summary(gasoline_lm).

    The R screen then appears as follows:

    Figure 7: Building the multiple linear regression model

As with the simple model, we need to first check whether the overall model is significant by looking at the p-value of the F-statistics, which appears as the last line of the summary output. Here, the value 0.0003 being very close to zero, the overall model is...