# #Epage 182 # # 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 = 20 SumX2 = 169 SXX = 90 b0 = 6 s2 = 25 # this is an estimate of the common variance (the same for all x's) ci = 0.95 alpha = 1 - ci t = qt( 1 - alpha/2, n-2 ) print( b0 - t * sqrt( s2 * SumX2 / ( n * SXX ) ) ) print( b0 + t * sqrt( s2 * SumX2 / ( n * SXX ) ) )