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 – partitioning the display plot


We first visualize the CART_Dummy dataset and then look in the next subsection at how CART gets the patterns, which are believed to exist in the data.

  1. Obtain the dataset CART_Dummy from the RSADBE package by using data( CART_Dummy).

  2. Convert the binary output Y as a factor variable, and attach the data frame with CART_Dummy$Y <- as.factor(CART_Dummy$Y).

    attach(CART_Dummy)

    In Figure 1: A complex classification dataset with partitions, the red squares refer to 0 and the green circles to 1.

  3. Initialize the graphics windows for the three samples by using par(mfrow= c(1,2)).

  4. Create a blank scatter plot:

    plot(c(0,12),c(0,10),type="n",xlab="X1",ylab="X2").
  5. Plot the green circles and red squares:

    points(X1[Y==0],X2[Y==0],pch=15,col="red")
    points(X1[Y==1],X2[Y==1],pch=19,col="green")
    title(main="A Difficult Classification Problem")
  6. Repeat the previous two steps to obtain the identical plot on the right side of the graphics window.

  7. First, partition according to...