diff --git a/src/site/xdoc/userguide/stat.xml b/src/site/xdoc/userguide/stat.xml index bceaa20a9..e85a449c3 100644 --- a/src/site/xdoc/userguide/stat.xml +++ b/src/site/xdoc/userguide/stat.xml @@ -513,13 +513,13 @@ regression.addData(y, x, omega); // we do need covariance where E(X) is the mean of X and E(Y) is the mean of the Y values. Non-bias-corrected estimates use n in place of n - 1. Whether or not covariances are - bias-corrected is determined by the optional constructor parameter, - "biasCorrected," which defaults to true. + bias-corrected is determined by the optional parameter, "biasCorrected," which + defaults to true.
  • - PearsonsCorrelation computes corralations defined by the formula

    - cor(X, Y) = sum[(xi - E(X))(yi - E(Y))] / [(n - 1)s(X)s(Y)] + PearsonsCorrelation computes correlations defined by the formula

    + cor(X, Y) = sum[(xi - E(X))(yi - E(Y))] / [(n - 1)s(X)s(Y)]
    where E(X) and E(Y) are means of X and Y and s(X), s(Y) are standard deviations.
  • @@ -579,8 +579,8 @@ new PearsonsCorrelation().computeCorrelationMatrix(data)
    Pearson's correlation significance and standard errors


    To compute standard errors and/or significances of correlation coefficients - associated with Pearson's correlation coefficients, start by creating a PearsonsCorrelation - instance from the data data using + associated with Pearson's correlation coefficients, start by creating a + PearsonsCorrelation instance PearsonsCorrelation correlation = new PearsonsCorrelation(data); @@ -593,16 +593,25 @@ correlation.getCorrelationStandardErrors(); SEr = ((1 - r2) / (n - 2))1/2
    where r is the estimated correlation coefficient and n is the number of observations in the source dataset.

    - p-values for the null hypothesis that respective coefficients are zero (also known as - significances) populate the RealMatrix returned by + p-values for the (2-sided) null hypotheses that elements of + a correlation matrix are zero populate the RealMatrix returned by -correlation.getCorrelationPValues(); +correlation.getCorrelationPValues() - getCorrelationPValues().getEntry(i,j) is the probability - that a random variable distributed as tn-2 takes + getCorrelationPValues().getEntry(i,j) is the + probability that a random variable distributed as tn-2 takes a value with absolute value greater than or equal to

    - |r|((n - 2) / (1 - r2))1/2, where r - is the estimated correlation coefficient. + |rij|((n - 2) / (1 - rij2))1/2, + where rij is the estimated correlation between the ith and jth + columns of the source array or RealMatrix. This is sometimes referred to as the + significance of the coefficient.

    + For example, if data is a RealMatrix with 2 columns and 10 rows, then + +new PearsonsCorrelation(data).getCorrelationPValues().getEntry(0,1) + + is the significance of the Pearson's correlation coefficient between the two columns + of data. If this value is less than .01, we can say that the correlation + between the two columns of data is significant at the 99% level.


    @@ -691,7 +700,7 @@ correlation.getCorrelationPValues(); double[] observed = {1d, 2d, 3d}; double mu = 2.5d; -System.out.println(TestUtils.t(mu, observed); +System.out.println(TestUtils.t(mu, observed)); The code above will display the t-statisitic associated with a one-sample t-test comparing the mean of the observed values against @@ -708,7 +717,7 @@ sampleStats = SummaryStatistics.newInstance(); for (int i = 0; i < observed.length; i++) { sampleStats.addValue(observed[i]); } -System.out.println(TestUtils.t(mu, observed); +System.out.println(TestUtils.t(mu, observed));
    To compute the p-value associated with the null hypothesis that the mean @@ -717,7 +726,7 @@ System.out.println(TestUtils.t(mu, observed); double[] observed = {1d, 2d, 3d}; double mu = 2.5d; -System.out.println(TestUtils.tTest(mu, observed); +System.out.println(TestUtils.tTest(mu, observed)); The snippet above will display the p-value associated with the null hypothesis that the mean of the population from which the