Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Data Science with SQL Server Quick Start Guide

You're reading from   Data Science with SQL Server Quick Start Guide Integrate SQL Server with data science

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789537123
Length 206 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dejan Sarka Dejan Sarka
Author Profile Icon Dejan Sarka
Dejan Sarka
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Writing Queries with T-SQL FREE CHAPTER 2. Introducing R 3. Getting Familiar with Python 4. Data Overview 5. Data Preparation 6. Intermediate Statistics and Graphs 7. Unsupervised Machine Learning 8. Supervised Machine Learning 1. Other Books You May Enjoy Index

Expressing dependencies with a linear regression formula


The simplest linear regression formula for two continuous variables is as follows:

The slope for this linear function is denoted with b and the intercept with a. When calculating these values, you try to find the line that fits the data points the best, where the deviations from the line are the smallest. The formula for the slope is as follows:

Once you have the slope, it is easy to calculate the intercept, as shown here:

The decision regarding which variable is dependent and which independent is up to you. Of course, this also depends on the problem you are trying to solve, and on common sense. For example, you would probably not model gender as a dependent variable of income, but would do the opposite. The formulas don't tell you that. You actually calculate two formulas, name the first regression line and the second regression line, with both variables playing a different role in each equation.

Here is the calculation of both slopes...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images