# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- n = 38 barY = 20 sumXSquared = 1922 SXY = 180 SXX = 60 s2 = 121 # this is an estimate of the common variance (the same for all x's) b1 = SXY / SXX barX = sqrt( - (SXX - sumXSquared)/n ) b0 = barY - b1 * barX T = b0 * sqrt( n*SXX / (s2 * sumXSquared) ) ci = 0.98 alpha = 1 - ci t = qt( 1 - alpha/2, n-2 ) # Part (c): # ci = 0.9 alpha = 1 - ci t = qt( 1 - alpha/2, n-2 ) print( b1 - t * sqrt( s2 / SXX ) ) print( b1 + t * sqrt( s2 / SXX ) )