Skip to content

Commit 0359a4b

Browse files
Merge pull request keshavsingh4522#143 from clubPenguin420/master
Doing statistics
2 parents 028fb51 + 033db0a commit 0359a4b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: LSRL-Calc.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
xBar = float(input("Enter the mean of x: "))
2+
Sx = float(input("Enter the Std of x: "))
3+
yBar = float(input("Enter the mean of y: "))
4+
Sy = float(input("Enter the Std of y: "))
5+
R = float(input("Enter the correlation coefficient(r): "))
6+
7+
b = R * (Sy / Sx)
8+
a = yBar - b * xBar
9+
print("The LSRL is: y-hat = %.3f + %.3fx" % (a, b))
10+

0 commit comments

Comments
 (0)