<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article How to Design Simple Linear Regression in Qlik Sense with help of Microsoft R(R Integration with Qlik Sense ) in Qlik Sense Documents</title>
    <link>https://community.qlik.com/t5/Qlik-Sense-Documents/How-to-Design-Simple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819551</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;Recent days, I have been exploring scope of R(&lt;STRONG&gt;R&lt;/STRONG&gt;&amp;nbsp;is a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Programming_language" target="_blank" rel="noopener"&gt;programming language&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Free_software" target="_blank" rel="noopener"&gt;free software&lt;/A&gt;&amp;nbsp;environment for&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Statistical_computing" target="_blank" rel="noopener"&gt;statistical computing&lt;/A&gt;&amp;nbsp;and graphics supported by the R Foundation for Statistical Computing&amp;nbsp;) with &lt;STRONG&gt;Qlik Sense&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This article is next step of &lt;A title="R Integration with Qlik Sense " href="https://community.qlik.com/t5/Knowledge-Base/R-Integration-with-Qlik-Sense/ta-p/1717165" target="_blank" rel="noopener"&gt;R Integration with Qlik Sense &lt;/A&gt;&amp;nbsp;which guide us how to install &lt;STRONG&gt;Microsoft R&lt;/STRONG&gt; either on Same server or different and connect with Qlik Sense Enterprise or Qlik Sense Desktop.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Basic Description:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Qlik Sense Advanced Analytics integration is essentially an extension to Qlik Sense’s expression syntax, and as such it can be used in both Chart Expressions, and in Load Script Expressions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this new capability, we are now able to add syntax to a chart expression that tells Qlik Sense that particular expression should not be evaluated on the Qlik Sense server, but instead, all the information and data needed to calculate that expression should be sent&amp;nbsp;via the server side extension on to the backend R system for calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;After the advanced analytic calculations are completed, the data is sent back to the Qlik Sense Server and to the client for visualization.&lt;/P&gt;&lt;P&gt;This article presumes R(either on Same server or different and connect with Qlik Sense Enterprise or Qlik Sense Desktop) is connected with Qlik Sense.&lt;/P&gt;&lt;P&gt;To Confirm the connection check RServe.exe CMD prompt:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_0-1625332751467.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57945iE8A8ED6491BEEB62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_0-1625332751467.png" alt="rohitk1609_0-1625332751467.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SSEtoRserve.exe&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_1-1625332775630.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57946iDB92F7764FAF61F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_1-1625332775630.png" alt="rohitk1609_1-1625332775630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If both consoles are showing running message it means we can start designing the&amp;nbsp;Simple Linear Regression:&lt;/P&gt;&lt;P&gt;Lets discuss&amp;nbsp;Simple Linear Regression,&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Statistics" target="_blank" rel="noopener"&gt;statistics&lt;/A&gt;,&amp;nbsp;&lt;STRONG&gt;simple linear regression&lt;/STRONG&gt;&amp;nbsp;is a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Linear_regression" target="_blank" rel="noopener"&gt;linear regression&lt;/A&gt;&amp;nbsp;model with a single&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Covariate" target="_blank" rel="noopener"&gt;explanatory variable&lt;/A&gt;.&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-1" target="_blank" rel="noopener"&gt;[1]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-:0-2" target="_blank" rel="noopener"&gt;[2]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-3" target="_blank" rel="noopener"&gt;[3]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-4" target="_blank" rel="noopener"&gt;[4]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-5" target="_blank" rel="noopener"&gt;[5]&lt;/A&gt;&amp;nbsp;That is, it concerns two-dimensional sample points with&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Dependent_and_independent_variables" target="_blank" rel="noopener"&gt;one independent variable and one dependent variable&lt;/A&gt;&amp;nbsp;(conventionally, the&amp;nbsp;&lt;EM&gt;x&lt;/EM&gt;&amp;nbsp;and&amp;nbsp;&lt;EM&gt;y&lt;/EM&gt;&amp;nbsp;coordinates in a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Cartesian_coordinate_system" target="_blank" rel="noopener"&gt;Cartesian coordinate system&lt;/A&gt;) and finds a linear function (a non-vertical&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Straight_line" target="_blank" rel="noopener"&gt;straight line&lt;/A&gt;) that, as accurately as possible, predicts the dependent variable values as a function of the independent variable.&lt;/P&gt;&lt;P&gt;Y=b0 + b1*x1&lt;/P&gt;&lt;P&gt;Y is dependent&amp;nbsp;variable&lt;/P&gt;&lt;P&gt;x is independent&amp;nbsp;variable which means it is causing&amp;nbsp;the change of value of Y(dependent&amp;nbsp;variable)&lt;/P&gt;&lt;P&gt;b1 is&amp;nbsp; Coefficient&amp;nbsp;which tells how much unit change in x1.&amp;nbsp;Coefficient&amp;nbsp; could be multiple or divide means anyhow it if affecting the value of x1.&lt;/P&gt;&lt;P&gt;b0 is constant&lt;/P&gt;&lt;P&gt;Lets discuss a simple use case:&lt;/P&gt;&lt;P&gt;We have two columns in a simple sheet(same sheet is attached) YearsExperience and &lt;STRONG&gt;Salary&lt;/STRONG&gt; and We are going to find what is the relation of Salary with YearsExperience.&lt;/P&gt;&lt;P&gt;Salary = b0&amp;nbsp; + b1*Experience&amp;nbsp;&lt;/P&gt;&lt;P&gt;b0= when experience&amp;nbsp;is 0 it means salary is 30k. it means when a person just joined the company, most probably that person has got 30k with no experience.&lt;/P&gt;&lt;P&gt;Red circle is b0 in&amp;nbsp; below image&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_0-1625307514234.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57937i41A9DB97AFF7588C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_0-1625307514234.png" alt="rohitk1609_0-1625307514234.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If slope is increasing&amp;nbsp;it means b1 is a positive number.&lt;/P&gt;&lt;P&gt;Black line is the linear regression line, we will find later what is best fit linear regression line.&lt;/P&gt;&lt;P&gt;Lets discuss this chart:&lt;/P&gt;&lt;P&gt;Red Plus signs &lt;STRONG&gt;+&lt;/STRONG&gt; are the salary numbers which employees are earning and Black line which is a regressor line is what they should earn&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_1-1625307572576.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57938i7314738F413632E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_1-1625307572576.png" alt="rohitk1609_1-1625307572576.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It draws lots of possible lines and counts the sum of those squares every single time and it records it temporary&amp;nbsp; and then it finds the minimum value and that minimum value its &lt;STRONG&gt;Ordinary Least Squares Method&lt;/STRONG&gt;. This is how simple linear regression works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data looks like&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;YearsExperience&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Salary&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;39343&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;46205&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;37731&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;43525&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2.2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;39891&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2.9&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;56642&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;60150&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So on..&lt;/P&gt;&lt;P&gt;If we execute Linear regression formula in &lt;STRONG&gt;R studio&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;regressor = lm(formula = Salary ~ YearsExperience,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data = training_set)&lt;/P&gt;&lt;P&gt;training set is the chuck of data on which we are running the Regressor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First it tells you what formula is, the first line in below snapshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_2-1625307610829.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57939i7F658747F9B5E694/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_2-1625307610829.png" alt="rohitk1609_2-1625307610829.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***(Three stars) tells the statistical&amp;nbsp;significance. If No start means no statistical&amp;nbsp;significance and if there are three stars *** means high&amp;nbsp;statistical&amp;nbsp;significance.&lt;/P&gt;&lt;P&gt;The lower of P value is means more impact of independent&amp;nbsp;variable&amp;nbsp; on dependent variable. P value tells the possibility or significance.&lt;/P&gt;&lt;P&gt;If you visualise the above formula in R studio this is how it looks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Blue line is Linear Regressor. It is the predictive salary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lets do the same thing is Qlik Sense:&lt;/P&gt;&lt;P&gt;import Advance Analytics Extension into Qlik Sense&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.qlik.com/garden/5979da222ef8975d99132f88" target="_blank" rel="noopener"&gt;https://developer.qlik.com/garden/5979da222ef8975d99132f88&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open Qlik Sense=&amp;gt;Hub=&amp;gt;Create App=&amp;gt;&lt;/P&gt;&lt;P&gt;Drag and Drop down the extension:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_3-1625307673247.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57940iE4CF116AB284F6C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_3-1625307673247.png" alt="rohitk1609_3-1625307673247.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select Simple Linear regression analysis&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_4-1625307713436.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57941i6D2B60C9A42CA07D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_4-1625307713436.png" alt="rohitk1609_4-1625307713436.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select Line chart with Linear Regression Line:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_5-1625307745310.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57942i2E14E3653D81A9D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_5-1625307745310.png" alt="rohitk1609_5-1625307745310.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select YearsExperience as Dimension and Salary as Measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_6-1625307770422.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57943iF8ECC1D318AB2DBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_6-1625307770422.png" alt="rohitk1609_6-1625307770422.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the outcome:&lt;/P&gt;&lt;P&gt;Qlik Sense has more advance graphic representation then R studio. It represents the formula, future predictive value, positive and negative area graph.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_7-1625307785450.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57944i83E0AE3730A7F9AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_7-1625307785450.png" alt="rohitk1609_7-1625307785450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Blue line is data actual points and red line is regressor line.&lt;/P&gt;&lt;P&gt;Data is same for both use cases, Representation in Qlik Sense has more impact than R, easy to create and manage.&lt;/P&gt;&lt;P&gt;Data appears in Qlik Sense but calculated in R.&lt;/P&gt;&lt;P&gt;Next regression model is : Multiple Linear Regression. Check out this document:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Documents/How-to-Design-Multiple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819573" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Documents/How-to-Design-Multiple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819573&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Rohit's Introduction" href="https://community.qlik.com/t5/Qlik-Design-Blog/Qlik-Community-Working-together-to-achieve-greater-success/ba-p/1680530" target="_self"&gt;Rohit's Introduction&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reach out to me at &lt;STRONG&gt;&lt;A href="mailto:kumar.rohit1609@gmail.com" target="_blank" rel="noopener nofollow noreferrer"&gt;kumar.rohit1609@gmail.com&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;if there is need of any clarification or need assistance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Connect with me on LinkedIn&amp;nbsp;&amp;nbsp;&lt;A href="https://in.linkedin.com/pub/rohit-kumar/2b/a15/67b" target="_blank" rel="noopener nofollow noreferrer"&gt;https://in.linkedin.com/pub/rohit-kumar/2b/a15/67b&lt;/A&gt;,&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get latest updates and articles, join my Facebook page&amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/QlikIntellectuals" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.facebook.com/QlikIntellectuals&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When applicable please mark the appropriate replies as ACCEPT AS SOLUTION and LIKE it. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as LIKE if you feel additional info is useful to others.&lt;/P&gt;</description>
    <pubDate>Sun, 04 Jul 2021 17:22:51 GMT</pubDate>
    <dc:creator>rohitk1609</dc:creator>
    <dc:date>2021-07-04T17:22:51Z</dc:date>
    <item>
      <title>How to Design Simple Linear Regression in Qlik Sense with help of Microsoft R(R Integration with Qlik Sense )</title>
      <link>https://community.qlik.com/t5/Qlik-Sense-Documents/How-to-Design-Simple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819551</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;Recent days, I have been exploring scope of R(&lt;STRONG&gt;R&lt;/STRONG&gt;&amp;nbsp;is a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Programming_language" target="_blank" rel="noopener"&gt;programming language&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Free_software" target="_blank" rel="noopener"&gt;free software&lt;/A&gt;&amp;nbsp;environment for&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Statistical_computing" target="_blank" rel="noopener"&gt;statistical computing&lt;/A&gt;&amp;nbsp;and graphics supported by the R Foundation for Statistical Computing&amp;nbsp;) with &lt;STRONG&gt;Qlik Sense&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This article is next step of &lt;A title="R Integration with Qlik Sense " href="https://community.qlik.com/t5/Knowledge-Base/R-Integration-with-Qlik-Sense/ta-p/1717165" target="_blank" rel="noopener"&gt;R Integration with Qlik Sense &lt;/A&gt;&amp;nbsp;which guide us how to install &lt;STRONG&gt;Microsoft R&lt;/STRONG&gt; either on Same server or different and connect with Qlik Sense Enterprise or Qlik Sense Desktop.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Basic Description:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Qlik Sense Advanced Analytics integration is essentially an extension to Qlik Sense’s expression syntax, and as such it can be used in both Chart Expressions, and in Load Script Expressions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this new capability, we are now able to add syntax to a chart expression that tells Qlik Sense that particular expression should not be evaluated on the Qlik Sense server, but instead, all the information and data needed to calculate that expression should be sent&amp;nbsp;via the server side extension on to the backend R system for calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;After the advanced analytic calculations are completed, the data is sent back to the Qlik Sense Server and to the client for visualization.&lt;/P&gt;&lt;P&gt;This article presumes R(either on Same server or different and connect with Qlik Sense Enterprise or Qlik Sense Desktop) is connected with Qlik Sense.&lt;/P&gt;&lt;P&gt;To Confirm the connection check RServe.exe CMD prompt:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_0-1625332751467.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57945iE8A8ED6491BEEB62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_0-1625332751467.png" alt="rohitk1609_0-1625332751467.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SSEtoRserve.exe&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_1-1625332775630.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57946iDB92F7764FAF61F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_1-1625332775630.png" alt="rohitk1609_1-1625332775630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If both consoles are showing running message it means we can start designing the&amp;nbsp;Simple Linear Regression:&lt;/P&gt;&lt;P&gt;Lets discuss&amp;nbsp;Simple Linear Regression,&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Statistics" target="_blank" rel="noopener"&gt;statistics&lt;/A&gt;,&amp;nbsp;&lt;STRONG&gt;simple linear regression&lt;/STRONG&gt;&amp;nbsp;is a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Linear_regression" target="_blank" rel="noopener"&gt;linear regression&lt;/A&gt;&amp;nbsp;model with a single&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Covariate" target="_blank" rel="noopener"&gt;explanatory variable&lt;/A&gt;.&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-1" target="_blank" rel="noopener"&gt;[1]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-:0-2" target="_blank" rel="noopener"&gt;[2]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-3" target="_blank" rel="noopener"&gt;[3]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-4" target="_blank" rel="noopener"&gt;[4]&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Simple_linear_regression#cite_note-5" target="_blank" rel="noopener"&gt;[5]&lt;/A&gt;&amp;nbsp;That is, it concerns two-dimensional sample points with&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Dependent_and_independent_variables" target="_blank" rel="noopener"&gt;one independent variable and one dependent variable&lt;/A&gt;&amp;nbsp;(conventionally, the&amp;nbsp;&lt;EM&gt;x&lt;/EM&gt;&amp;nbsp;and&amp;nbsp;&lt;EM&gt;y&lt;/EM&gt;&amp;nbsp;coordinates in a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Cartesian_coordinate_system" target="_blank" rel="noopener"&gt;Cartesian coordinate system&lt;/A&gt;) and finds a linear function (a non-vertical&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Straight_line" target="_blank" rel="noopener"&gt;straight line&lt;/A&gt;) that, as accurately as possible, predicts the dependent variable values as a function of the independent variable.&lt;/P&gt;&lt;P&gt;Y=b0 + b1*x1&lt;/P&gt;&lt;P&gt;Y is dependent&amp;nbsp;variable&lt;/P&gt;&lt;P&gt;x is independent&amp;nbsp;variable which means it is causing&amp;nbsp;the change of value of Y(dependent&amp;nbsp;variable)&lt;/P&gt;&lt;P&gt;b1 is&amp;nbsp; Coefficient&amp;nbsp;which tells how much unit change in x1.&amp;nbsp;Coefficient&amp;nbsp; could be multiple or divide means anyhow it if affecting the value of x1.&lt;/P&gt;&lt;P&gt;b0 is constant&lt;/P&gt;&lt;P&gt;Lets discuss a simple use case:&lt;/P&gt;&lt;P&gt;We have two columns in a simple sheet(same sheet is attached) YearsExperience and &lt;STRONG&gt;Salary&lt;/STRONG&gt; and We are going to find what is the relation of Salary with YearsExperience.&lt;/P&gt;&lt;P&gt;Salary = b0&amp;nbsp; + b1*Experience&amp;nbsp;&lt;/P&gt;&lt;P&gt;b0= when experience&amp;nbsp;is 0 it means salary is 30k. it means when a person just joined the company, most probably that person has got 30k with no experience.&lt;/P&gt;&lt;P&gt;Red circle is b0 in&amp;nbsp; below image&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_0-1625307514234.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57937i41A9DB97AFF7588C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_0-1625307514234.png" alt="rohitk1609_0-1625307514234.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If slope is increasing&amp;nbsp;it means b1 is a positive number.&lt;/P&gt;&lt;P&gt;Black line is the linear regression line, we will find later what is best fit linear regression line.&lt;/P&gt;&lt;P&gt;Lets discuss this chart:&lt;/P&gt;&lt;P&gt;Red Plus signs &lt;STRONG&gt;+&lt;/STRONG&gt; are the salary numbers which employees are earning and Black line which is a regressor line is what they should earn&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_1-1625307572576.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57938i7314738F413632E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_1-1625307572576.png" alt="rohitk1609_1-1625307572576.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It draws lots of possible lines and counts the sum of those squares every single time and it records it temporary&amp;nbsp; and then it finds the minimum value and that minimum value its &lt;STRONG&gt;Ordinary Least Squares Method&lt;/STRONG&gt;. This is how simple linear regression works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data looks like&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;YearsExperience&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Salary&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;39343&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;46205&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;37731&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;43525&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2.2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;39891&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2.9&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;56642&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;60150&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So on..&lt;/P&gt;&lt;P&gt;If we execute Linear regression formula in &lt;STRONG&gt;R studio&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;regressor = lm(formula = Salary ~ YearsExperience,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data = training_set)&lt;/P&gt;&lt;P&gt;training set is the chuck of data on which we are running the Regressor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First it tells you what formula is, the first line in below snapshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_2-1625307610829.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57939i7F658747F9B5E694/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_2-1625307610829.png" alt="rohitk1609_2-1625307610829.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***(Three stars) tells the statistical&amp;nbsp;significance. If No start means no statistical&amp;nbsp;significance and if there are three stars *** means high&amp;nbsp;statistical&amp;nbsp;significance.&lt;/P&gt;&lt;P&gt;The lower of P value is means more impact of independent&amp;nbsp;variable&amp;nbsp; on dependent variable. P value tells the possibility or significance.&lt;/P&gt;&lt;P&gt;If you visualise the above formula in R studio this is how it looks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Blue line is Linear Regressor. It is the predictive salary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lets do the same thing is Qlik Sense:&lt;/P&gt;&lt;P&gt;import Advance Analytics Extension into Qlik Sense&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.qlik.com/garden/5979da222ef8975d99132f88" target="_blank" rel="noopener"&gt;https://developer.qlik.com/garden/5979da222ef8975d99132f88&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open Qlik Sense=&amp;gt;Hub=&amp;gt;Create App=&amp;gt;&lt;/P&gt;&lt;P&gt;Drag and Drop down the extension:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_3-1625307673247.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57940iE4CF116AB284F6C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_3-1625307673247.png" alt="rohitk1609_3-1625307673247.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select Simple Linear regression analysis&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_4-1625307713436.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57941i6D2B60C9A42CA07D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_4-1625307713436.png" alt="rohitk1609_4-1625307713436.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select Line chart with Linear Regression Line:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_5-1625307745310.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57942i2E14E3653D81A9D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_5-1625307745310.png" alt="rohitk1609_5-1625307745310.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select YearsExperience as Dimension and Salary as Measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_6-1625307770422.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57943iF8ECC1D318AB2DBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_6-1625307770422.png" alt="rohitk1609_6-1625307770422.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the outcome:&lt;/P&gt;&lt;P&gt;Qlik Sense has more advance graphic representation then R studio. It represents the formula, future predictive value, positive and negative area graph.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rohitk1609_7-1625307785450.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57944i83E0AE3730A7F9AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rohitk1609_7-1625307785450.png" alt="rohitk1609_7-1625307785450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Blue line is data actual points and red line is regressor line.&lt;/P&gt;&lt;P&gt;Data is same for both use cases, Representation in Qlik Sense has more impact than R, easy to create and manage.&lt;/P&gt;&lt;P&gt;Data appears in Qlik Sense but calculated in R.&lt;/P&gt;&lt;P&gt;Next regression model is : Multiple Linear Regression. Check out this document:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Documents/How-to-Design-Multiple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819573" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Documents/How-to-Design-Multiple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819573&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Rohit's Introduction" href="https://community.qlik.com/t5/Qlik-Design-Blog/Qlik-Community-Working-together-to-achieve-greater-success/ba-p/1680530" target="_self"&gt;Rohit's Introduction&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reach out to me at &lt;STRONG&gt;&lt;A href="mailto:kumar.rohit1609@gmail.com" target="_blank" rel="noopener nofollow noreferrer"&gt;kumar.rohit1609@gmail.com&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;if there is need of any clarification or need assistance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Connect with me on LinkedIn&amp;nbsp;&amp;nbsp;&lt;A href="https://in.linkedin.com/pub/rohit-kumar/2b/a15/67b" target="_blank" rel="noopener nofollow noreferrer"&gt;https://in.linkedin.com/pub/rohit-kumar/2b/a15/67b&lt;/A&gt;,&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get latest updates and articles, join my Facebook page&amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/QlikIntellectuals" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.facebook.com/QlikIntellectuals&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When applicable please mark the appropriate replies as ACCEPT AS SOLUTION and LIKE it. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as LIKE if you feel additional info is useful to others.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 17:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Sense-Documents/How-to-Design-Simple-Linear-Regression-in-Qlik-Sense-with-help/ta-p/1819551</guid>
      <dc:creator>rohitk1609</dc:creator>
      <dc:date>2021-07-04T17:22:51Z</dc:date>
    </item>
  </channel>
</rss>

