i
Exploring R
Evolution of R
Programming Features of R
R for Machine Learning
R for Data Analysis
Application of R
R vs. Python vs. SAS
R vs. Excel vs.Tableau
Install R base on Windows
Install R Studio on Windows
Install R base on Ubuntu
Install R Studio on Ubuntu
R Starter
First R Program
Working with R Packages
R Workplace and R Sessions
Manage working directory
Customize R studio
RStudio Debugger
RStudio History and Environment variables
R Syntax
R Variables
R Data Types & Structures
R Arithmetic Operators
R Logical Operators
R If Statement
R - If…Else Statement
If…else if…Else Statement
R for loop
R while loop
R repeat loop
R String Construction
R String Manipulation Functions
Creating Character Strings
R Functions
R built-in functions
Working with Vector
R Vector Indexing
R Vector Modification
R Arithmetic Vector Operations
R Lists
Access List elements (List Slicing)
List modification
R Matrix construction
Access Matrix elements
R Matrix Modification
R Matrix Operations
R Array Construction
Accessing Array Elements
Manipulating Array Elements
R Data Frames
Data Extraction
Data Frame Expansion
R Built-in Data frames
R Factors
Manage Factor levels
Factor Functions
R Contingency Tables
R Data Visualization
R – Charts and Graphs
R Density Plot
R Strip Charts
R Boxplots
R Violin Plots
R Bar Charts
R Pie Charts
R Area Plots
R Time Series
Graphics with ggplot2
Ggplot2 Structure
ggplot2 Bar Charts
ggplot2 Pie Chart
ggplot2 Area Plot
ggplot2 Histogram
ggplot2 Scatter Plot
ggplot2 Box Plot
Mean & Median
Standard Deviation
Normal Distribution
Correlation
T-Tests
Chi-Square Test
ANOVA Test
Survival Analysis
Data Pre-processing and Missing Value Analysis
Missing data treatment
Missing value analysis with mice package
Outlier Analysis
Problems with outliers
Outlier Detection
Outlier Treatment
Simple Linear Regression
Mathematical Computation
Linear Regression in R
A complete Simple Regression Analysis
Multiple Linear Regression
Mathematical Analysis
Model Interpretation
A complete Multiple Regression Analysis
Logistic Regression
Mathematical Computation in R
Logistic Regression in R
Heart Risk Analysis using LR
Support Vector Machine
Heart Risk Analysis using SVM
Decision Trees
Random Forest
K means Clustering
Big data Analytics using R-Hadoop
RHADOOP Packages:
rJava: Low-Level R to Java Interface
rhdfs: Integrate R with HDFS
rmr2: MapReduce job in R
plyrmr: Data Manipulation with MapReduce job
rhbase: Integrate HBase with R
Environment setup for RHADOOP
Getting Started with RHADOOP
Coronary heart diseases remain one of the leading causes of death all over the world. One of the biggest contributors to coronary disease is a lack of commitment to a heart-healthy lifestyle and the consequences associated with it.
This project aims at early detection that means finding out whether the patients have the risk of coronary heart disease in the next ten years. We have used the Data Set, heartdata for this analysis.
Step 1: We are going to split the dataset into training and test set.
Step 2: Train the model using the training set.
Model Summary:
This summary function will display the detail of the model.
The first column is for the predictor's name. The next one is for the value of the co-efficient, then Standard error, after that z value and finally p-value.
The standard significance level is 5%. We are going to choose all the predictors whose p-value is less than the significance level. So male, age, cigsPerDay, sysBP, totalChol, and glucose are the significant predictors.
Step 3: Model Prediction using Test data set.
We will predict TenYearCHD, for this separate test dataset using our Logistic Regression model heartLR. It will generate the below result.
Outcome:
For row 17, it has predicted TenTearCHD as .1557. For the 300th row, the predicted result is .2739. Our model will return all the predicted outcome for TenYearCHD.
Step 4: Model Evaluation using Confusion Matrix and ROC Curve:
In this section, we are going to evaluate the model first using the Confusion Matrix and then using the ROC Curve.
Confusion Matrix: A confusion matrix is a table often used to define a classification model's performance on a set of test data for which the true values are identified. It allows the visualization of the performance of an algorithm.
We are going to use the table function to create our confusion matrix. We will compare our predicted value with the expected value. We will set a threshold, and based on that; we will run the function. It will generate the below table.
Graphical Representation:
Model Accuracy:
Baseline Accuracy:
Other Parameters:
AUC-ROC Curve: AUC - ROC curve is a performance measurement for the classification problem at various threshold settings. ROC is a probability curve, and AUC represents the degree or measure of separability. It tells how much model is capable of distinguishing between classes.
ROC-AUC Curve:
Don't miss out!