Project 49: Lin Reg T Interval
Intro Problem: An AP Statistics teacher wants to estimate the true slope between number of classes missed for a unit and the student's unit test score at the 96% confidence level. He collects the following data from 7 students.
number of missed classes: 0 1 4 2 3 0 1
unit test grade: 90 85 70 84 78 93 88
b = sample slope = -5.03
seSlope = .525
Explanation:
d.f. = n - 2 = 5
critical value = 2.76 (with 5 degrees of freedom 96% of the t-distribution is between -2.76 and 2.76)
margin of error = .525*2.76 = 1.45
CI: -5.03 ± 1.45 = [-6.48, -3.58]
We are 96% confident that the true slope between number of classes missed and unit test score for this AP Statistics teacher's students is between -6.48 and -3.58.
Project 49: Variables 'x', 'y', and 'confidenceLevel' have been initialized. There are also working methods getM, getB, getSESlope, tcdf, and invT.
x and y are the x and y values of the sample.
getM(x,y) returns the slope of the LSRL for x and y
getB(x,y) returns the y-intercept of the LSRL for x and y.
getSESlope(x,y) returns the standard error of the slope.
tcdf(low, high, df) returns the probability that t is between low and high (with 'df' degrees of freedom)
invT(area, df) returns the t-score with left-tail area given (and 'df' degrees of freedom)
Task: Appropriately initialize the values 'lower' and 'upper' that represent the lower and upper endpoints of the linear regression t-interval given.
**If your code works for 5 test cases, you can enter your e-mail address
Universal Computational Math Methods:
pow(5,2) returns 25.0
abs(-3.0) returns 3
sqrt(49.0) returns 7.0