lib/linefit.rb
############################################################################
# Return the T statistics
#
#  tStatIntercept, tStatSlope = linefit.tStatistics
#
# The t statistic, also called the t ratio or Wald statistic, is used to
# accept or reject a hypothesis using a table of cutoff values computed
# from the t distribution. The t-statistic suggests that the estimated
# value is (reasonable, too small, too large) when the t-statistic is
# (close to zero, large and positive, large and negative).
#
# The returned list is undefined if the regression fails. If weights are
# input, the returned values are the weighted t statistics.
#
Return the T statistics
tStatIntercept, tStatSlope = linefit.tStatistics

The t statistic, also called the t ratio or Wald statistic, is used to
accept or reject a hypothesis using a table of cutoff values computed
from the t distribution. The t-statistic suggests that the estimated
value is (reasonable, too small, too large) when the t-statistic is
(close to zero, large and positive, large and negative).

The returned list is undefined if the regression fails. If weights are
input, the returned values are the weighted t statistics.
Return the T statistics tStatIntercept tStatSlope = linefit . tStatistics The t statistic also called the t ratio or Wald statistic is used to accept or reject a hypothesis using a table of cutoff values computed from the t distribution . The t - statistic suggests that the estimated value is ( reasonable too small too large ) when the t - statistic is ( close to zero large and positive large and negative ) . The returned list is undefined if the regression fails . If weights are input the returned values are the weighted t statistics .
def tStatistics
      unless (@tStatInt and @tStatSlope)
         self.regress or return
         biasEstimateInt = sigma() * Math.sqrt(@sumxx / (@sumSqDevx * @numxy))
         @tStatInt = biasEstimateInt != 0 ? @intercept / biasEstimateInt : 0
         biasEstimateSlope = sigma() / Math.sqrt(@sumSqDevx)
         @tStatSlope = biasEstimateSlope != 0 ? @slope / biasEstimateSlope : 0
      end
      return @tStatInt, @tStatSlope
   end
def tStatistics unless ( @tStatInt and @tStatSlope ) self . regress or return biasEstimateInt = sigma ( ) * Math . sqrt ( @sumxx / ( @sumSqDevx * @numxy ) ) @tStatInt = biasEstimateInt != 0 ? @intercept / biasEstimateInt : 0 biasEstimateSlope = sigma ( ) / Math . sqrt ( @sumSqDevx ) @tStatSlope = biasEstimateSlope != 0 ? @slope / biasEstimateSlope : 0 end return @tStatInt , @tStatSlope end
Return the T statistics
tStatIntercept, tStatSlope = linefit.tStatistics
Return the T statistics tStatIntercept tStatSlope = linefit . tStatistics