This article is about simple calculation of parameters of linear regression in R script.

If you are interested in linear regression in Excel, click here.

Let´s start with data uploading. In this example we will observe the dependency of sales on number of adds.

Create a data frame from vectors:

Create a linear model from data frame.

Now you can show the model and its parameters:

(Intercept) number_of_adds 
-2.377 1.899

You can also draw it:

What does the results mean?

  • The dots in charts makes quite straight increasing line. This means there is positive linear dependency - the more adds, the bigger sales. 
  • The parameter -2,377 says in which point this line crosses the y axis.
  • The parameter 1,899 describes the steepness of line - the higher, the bigger impact of adds on sales.

Leave a Reply

Your email address will not be published.


clear formPost comment