Code Monkey home page Code Monkey logo

linear-regression-in-sql's Introduction

Linear-Regression-in-SQL

In this exercise we will try to learn how can we implement linear regression just using SQL.

Table of content

First create the database using the raw file before attempting the following:

  1. Data for regression
  2. Regression coefficients
  3. Linear time trend
  4. Statistical significance test
  5. Orthogonal contrast codes
  6. Linear time trend and seasonality

The R code file is also shared to do the final analysis and calculating necessary parameters to understand the ouput of the regression from this exercise.

Data

The data for the experiment is available inside the 'data' folder in this repository. Also, the output from each process outlined above will be shared in the same folder.

Reading

I came across this idea through an online article via mode.com by Julia Glick. I have uploaded the reading material in the repository for your reading. Given the size of the file, one must download the folder to get access to the file. I don't claim exclusive rights on the technique but this is an impressive take on Statistics using SQL.

References

Following answers on stack overflow were quite helpful in understanding the execution in SQL:

  1. https://stackoverflow.com/questions/2536895/are-there-any-linear-regression-function-in-sql-server
  2. https://stackoverflow.com/questions/28262939/multiple-linear-regression-function-in-sql-server

linear-regression-in-sql's People

Contributors

tanaymukherjee avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.