Skip to main content

Simple Linear Regression

 Simple Linear Regression

 

Simple linear regression is used to find out the best relationship between a single input variable (predictor, independent variable, input feature, input parameter) & output variable (predicted, dependent variable, output feature, output parameter) provided that both variables are continuous in nature. This relationship represents how an input variable is related to the output variable and how it is represented by a straight line.


After looking at scatter plot we can understand:

  1. The direction
  2. The strength
  3. The linearity

The above characteristics are between variable Y and variable X. The above scatter plot shows us that variable Y and variable X possess a strong positive linear relationship. Hence, we can project a straight line which can define the data in the most accurate way possible.

If the relationship between variable X and variable Y is strong and linear, then we conclude that particular independent variable X is the effective input variable to predict dependent variable Y.

To check the collinearity between variable X and variable Y, we have correlation coefficient (r), which will give you numerical value of correlation between two variables. You can have strong, moderate or weak correlation between two variables. Higher the value of “r”, higher the preference given for particular input variable X for predicting output variable Y. Few properties of “r” are listed as follows:

  1. Range of r: -1 to +1
  2. Perfect positive relationship: +1
  3. Perfect negative relationship: -1
  4. No Linear relationship: 0
  5. Strong correlation: r > 0.85 (depends on business scenario)

Command used for calculation “r” in RStudio is:

> cor(X, Y)

where, X: independent variable & Y: dependent variable Now, if the result of the above command is greater than 0.85 then choose simple linear regression.

If r < 0.85 then use transformation of data to increase the value of “r” and then build a simple linear regression model on transformed data.

Steps to Implement Simple Linear Regression:

  1. Analyze data (analyze scatter plot for linearity)
  2. Get sample data for model building
  3. Then design a model that explains the data
  4. And use the same developed model on the whole population to make predictions.

Comments

Popular posts from this blog

Understanding Logistic Regression using R

  1. What is Logistic Regression? Logistic Regression is one of the machine learning algorithms used for solving classification problems. It is used to estimate probability whether an instance belongs to a class or not. If the estimated probability is greater than threshold, then the model predicts that the instance belongs to that class, or else it predicts that it does not belong to the class as shown in fig 1. This makes it a binary classifier. Logistic regression is used where the value of the dependent variable is 0/1, true/false or yes/no. Example 1 Suppose we are interested to know whether a candidate will pass the entrance exam. The result of the candidate depends upon his attendance in the class, teacher-student ratio, knowledge of the teacher and interest of the student in the subject are all independent variables and result is dependent variable. The value of the result will be yes or no. So, it is a binary classification problem. Practical Implementation of Logistic Regres

Data science: A Blend of These Data Components

Data Science Course ExcelR offers Data Science course, the most comprehensive Data Science course in the market, covering the complete Data Science lifecycle concepts from Data Collection, Data Extraction, Data Cleansing, Data Exploration, Data Transformation, Feature Engineering, Data Integration, Data Mining, building Prediction models, Data Visualization and deploying the solution to the customer. Skills and tools ranging from  Statistical Analysis , Text Mining, Regression Modelling, Hypothesis Testing, Predictive Analytics,  Machine Learning ,   Deep Learning, Neural Networks, Natural Language Processing, Predictive Modelling, R Studio, XLMiner,  Tableau , Spark, Hadoop, Minitab, programming languages like R programming ,  Python are covered extensively as part of this Data Science training. ExcelR is considered as the best Data Science training institute which offers services from training to placement as part of the Data Science training program with over 400+ participant

Knowledge Science, Enterprise Analytics Programs

Increase your analytics career with highly effective new Microsoft® Excel abilities by taking this Business Analytics with Excel course, which includes Energy BI coaching. Information Science is a area which is consistently evolving and constantly making manner for brand new technologies to be picked up. Many firms and professionals are mastered to stay ahead within the competition. Course Content (Score 4.5): The core course contains Statistics and likelihood, R and Python for Information Science, Hadoop, big information with Apache Spark, machine studying for information science, IBM Watson analytics, enterprise use instances of big information and data science and much more. College students had been enlightened by his profound information and business experience on Digital Advertising. This Big Information provides problem in term of storage and further analysis in rest of in real time. Information science is a combination of statistics, mathematics, computers, algorithms and a