Lesson 15: Calculating Sum of Squares in Python

2
March 30, 2017 at 10:00 am  •  Posted in s17-busad360 by  •  2 Comments

Thu, Mar 30

Review:

  • Big Data Analytics
  • Intro to Python
  • Hello World Program

Presentation:

Assignment:

  • Write a program to calculate SSxx, SSyy and SSxy using the data set below
    • Data set 1: {(3,5), (5,8), (8,11), (12,10)}
  • Challenge:
    • Write a Python program that does the following
      • Calculates Pearson Correlation Coefficient
      • Calculates Slope and Y-Intercept
      • Prints results to screen

2 Comments

  1. Chris Henager / April 18, 2017 at 7:29 pm / Reply

    I’m having a hard time writing the formula for y intercept into python. it keeps giving me a syntax error. This is how i tried to input it- y intercept = (SumY/n – slope * SumX/n)

  2. Justin / April 18, 2017 at 7:53 pm / Reply

    If you are typing “y intercept” with a space it won’t work. Take out the space.
    The rest looks okay. I would write it like this:

    yintercept = (SumY/n) – slope*(SumX/n)

Leave a Reply