From the course: SQL for Statistics Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Computing slope - PostgreSQL Tutorial
From the course: SQL for Statistics Essential Training
Computing slope
- [Instructor] The slope of a line tell us how fast the line rises or falls as it moves away from the point of the y-intercept. If we know what the intercept is, then we just need to find the slope to make predictions using the regression line. So here is a statement to find the slope. It is simply, select, regression slope, again regression is shortened to R-E-G-R, and the y-axis is employee shifts, and the x-axis is units sold. And we select this from our store sales table. And what we find is, that our slope is about 0.0033, okay? Now, be sure to have columns in the same order that they were when you used when calculating the intercept. So let's calculate the intercept again so that we have the value, just fresh in our mind. And I'm going to do that by just changing the word slope to intercept. And we'll see that our intercept is about 2.41, which we saw in our previous video. So, we know the intercept, and we know slope, how do we make a prediction? Well, we use a formula from…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.