Lesson 15: Calculating Sum of Squares in Python
March 30, 2017
Thu, Mar 30
Review:
- Big Data Analytics
- Intro to Python
- Hello World Program
Presentation:
- Sum of Squares calculations in Python
- See Lesson 1 to review
- Python Anywhere
- Demonstrate program in 3 parts
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
- Write a Python program that does the following
2 Comments
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)
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)