public void calculateDerived(){
  xStats.calculateDerived();
  yStats.calculateDerived();
  differencesStats.calculateDerived();
  correlation=Double.NaN;
  if (!Double.isNaN(xStats.stdDev) && !Double.isNaN(yStats.stdDev) && !Utils.eq(xStats.stdDev,0)) {
    double slope=(xySum - xStats.sum * yStats.sum / count) / (xStats.sumSq - xStats.sum * xStats.mean);
    if (!Utils.eq(yStats.stdDev,0)) {
      correlation=slope * xStats.stdDev / yStats.stdDev;
    }
 else {
      correlation=1.0;
    }
  }
  if (Utils.gr(differencesStats.stdDev,0)) {
    double tval=differencesStats.mean * Math.sqrt(count) / differencesStats.stdDev;
    if (m_degreesOfFreedom >= 1) {
      differencesProbability=Statistics.FProbability(tval * tval,1,m_degreesOfFreedom);
    }
 else {
      if (count > 1) {
        differencesProbability=Statistics.FProbability(tval * tval,1,(int)count - 1);
      }
 else {
        differencesProbability=1;
      }
    }
  }
 else {
    if (differencesStats.sumSq == 0) {
      differencesProbability=1.0;
    }
 else {
      differencesProbability=0.0;
    }
  }
  differencesSignificance=0;
  if (differencesProbability <= sigLevel) {
    if (xStats.mean > yStats.mean) {
      differencesSignificance=1;
    }
 else {
      differencesSignificance=-1;
    }
  }
}

public void calculateDerived ( ) { xStats . calculateDerived ( ) ; yStats . calculateDerived ( ) ; differencesStats . calculateDerived ( ) ; correlation = Double . NaN ; if ( ! Double . isNaN ( xStats . stdDev ) && ! Double . isNaN ( yStats . stdDev ) && ! Utils . eq ( xStats . stdDev , 0 ) ) { double slope = ( xySum - xStats . sum * yStats . sum / count ) / ( xStats . sumSq - xStats . sum * xStats . mean ) ; if ( ! Utils . eq ( yStats . stdDev , 0 ) ) { correlation = slope * xStats . stdDev / yStats . stdDev ; } else { correlation = 1.0 ; } } if ( Utils . gr ( differencesStats . stdDev , 0 ) ) { double tval = differencesStats . mean * Math . sqrt ( count ) / differencesStats . stdDev ; if ( m_degreesOfFreedom >= 1 ) { differencesProbability = Statistics . FProbability ( tval * tval , 1 , m_degreesOfFreedom ) ; } else { if ( count > 1 ) { differencesProbability = Statistics . FProbability ( tval * tval , 1 , ( int ) count - 1 ) ; } else { differencesProbability = 1 ; } } } else { if ( differencesStats . sumSq == 0 ) { differencesProbability = 1.0 ; } else { differencesProbability = 0.0 ; } } differencesSignificance = 0 ; if ( differencesProbability <= sigLevel ) { if ( xStats . mean > yStats . mean ) { differencesSignificance = 1 ; } else { differencesSignificance = - 1 ; } } }
calculates the derived statistics ( significance etc ) .
