This article is next step of R Integration with Qlik Sense which guide us how to install Microsoft R either on Same server or different and connect with Qlik Sense Enterprise or Qlik Sense Desktop.
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.
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 via the server side extension on to the backend R system for calculation.
After the advanced analytic calculations are completed, the data is sent back to the Qlik Sense Server and to the client for visualization.
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.
To Confirm the connection check RServe.exe CMD prompt:
If both consoles are showing running message it means we can start designing the Simple Linear Regression:
x is independent variable which means it is causing the change of value of Y(dependent variable)
b1 is Coefficient which tells how much unit change in x1. Coefficient could be multiple or divide means anyhow it if affecting the value of x1.
b0 is constant
Lets discuss a simple use case:
We have two columns in a simple sheet(same sheet is attached) YearsExperience and Salary and We are going to find what is the relation of Salary with YearsExperience.
Salary = b0 + b1*Experience
b0= when experience 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.
Red circle is b0 in below image
If slope is increasing it means b1 is a positive number.
Black line is the linear regression line, we will find later what is best fit linear regression line.
Lets discuss this chart:
Red Plus signs + are the salary numbers which employees are earning and Black line which is a regressor line is what they should earn
It draws lots of possible lines and counts the sum of those squares every single time and it records it temporary and then it finds the minimum value and that minimum value its Ordinary Least Squares Method. This is how simple linear regression works.
Sample data looks like
If we execute Linear regression formula in R studio:
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.