public final class VStats
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static double |
computeA(double[] indVar,
double[] depVar)
Returns the y-intercept of the least-squares regression line (LSRL) equation,
in a
double format. |
static double |
computeB(double[] indVar,
double[] depVar)
Returns the slope of the least-squares regression line (LSRL) equation, in a
double format. |
static double |
computeBinomialCdfProb(int numTrials,
int inputLBound,
int inputHBound,
double pSuccess)
Returns the binomial probability of an interval of x-values, in a
double format. |
static double |
computeBinomialPdfProb(int numTrials,
int xVal,
double pSuccess)
Returns the binomial probability of a single x-value, in a
double format. |
static double |
computeChiSquareCDF(double lowerBound,
double upperBound,
int degFree)
Returns the area (probability) under the chi-square function between 2
chi-square values.
|
static java.lang.String |
computeChiSquareGOFTest(double[] observed,
double[] expected,
double alpha)
Returns the final decision and p-value of the chi-square goodness of fit
(GOF) test.
|
static double |
computeChiSquarePDF(double chiSqrValue,
int degFree)
Returns the output of the chi-square function when provided a chi-square
value and the degrees of freedom.
|
static java.lang.String |
computeChiSquareTwoWayTest(double[][] observed,
double alpha)
Returns the final decision and p-value of a two-way chi-square test.
|
static double |
computeColumnProduct(double[][] inputData,
int col)
Returns the product of the elements of a column in a 2D array (0-based
index), as a
double format. |
static double |
computeColumnSum(double[][] inputData,
int col)
Returns the sum of the elements of a column in a 2D array (0-based index), as
a
double format. |
static int |
computeCombinations(int n,
int r)
Returns the number of combinations (in
int format) possible when
given the n-value and r-value (with respect to the format: nCr). |
static double |
computeDiscreteExpectedValue(double[] inputDataArray,
double[] probabilitiesArray)
Returns the expected value of a discrete random variable, in a
double format. |
static double |
computeDiscreteStandardDeviation(double[] inputDataArray,
double[] probabilitiesArray)
Returns the standard deviation of a discrete random variable, in a
double format. |
static double |
computeDiscreteVariance(double[] inputDataArray,
double[] probabilitiesArray)
Returns the variance of a discrete random variable, in a
double
format. |
static int |
computeFactorial(int inputVal)
Returns the factorial (in
int format) of an int . |
static double |
computeGammaFunction(double inputZ)
Returns the an approximation of the gamma function when given an input.
|
static double |
computeGeometricCdfProb(double pSuccess,
int inputLowBound,
int inputHighBound)
Returns the geometric probability of an interval of x-values, in a
double format. |
static double |
computeGeometricPdfProb(int xVal,
double pSuccess)
Returns the geometric probability of a single x-value, in a
double format. |
static double |
computeInverseNormalApprox(double input)
Returns the corresponding z-score with respect to the left area under the
probability density function (for normal distributions).
|
static double |
computeIQR(double[] inputData)
Returns the interquartile range (IQR) of a
double array, in a
double format. |
static java.lang.String |
computeLinRegTTestNegativeSlope(double[] indVar,
double[] depVar,
double alpha)
Returns the final decision and p-value of a linear regression t-test.
|
static java.lang.String |
computeLinRegTTestPositiveSlope(double[] indVar,
double[] depVar,
double alpha)
Returns the final decision and p-value of a linear regression t-test.
|
static java.lang.String |
computeLinRegTTestUnequalSlope(double[] indVar,
double[] depVar,
double alpha)
Returns the final decision and p-value of a linear regression t-test.
|
static double |
computeLSRLOutput(double[] indVar,
double[] depVar,
double input)
Returns a
double which represents the predicted y-value (ŷ) when
an x-value is inputted into the least-squares regression line (LSRL). |
static double |
computeMAD(double[] inputData)
Returns the mean absolute deviation (MAD) of a
double array, in
a double format. |
static double[][] |
computeMatrixAddition(double[][] arr1,
double[][] arr2)
Returns a
double 2D array containing the sum of the 2 parameter
matrices (2D arrays). |
static double[][] |
computeMatrixMultiplicationByScalar(double[][] arr,
double scalar)
Returns a
double 2D array containing the product of a matrix and
a scalar. |
static double[][] |
computeMatrixSubtraction(double[][] arr1,
double[][] arr2)
Returns a
double 2D array containing the difference of the 2
parameter matrices (2D arrays). |
static double |
computeMaximum(double[] inputData)
Returns the maximum value of a
double array, in a
double format. |
static double |
computeMean(double[] inputData)
Returns the mean (average) of a
double array, in a
double format. |
static double |
computeMedian(double[] inputData)
Returns the median (second quartile) of a
double array, in a
double format. |
static double |
computeMinimum(double[] inputData)
Returns the minimum value of a
double array, in a
double format. |
static double |
computeMode(double[] inputData)
Returns the mode (most occurring value) of a
double array, in a
double format. |
static double |
computeNormalPDF(double inputZ)
Returns the output (in a
double format) of the probability
density function (for normal distributions). |
static java.lang.String |
computeOneMeanTTestHaGreaterThanValue(double mu,
double sampleMean,
double sampleSD,
int sampleSize,
double alpha)
Returns the final decision and p-value of a significance test, utilizing the
t-distribution.
|
static java.lang.String |
computeOneMeanTTestHaLessThanValue(double mu,
double sampleMean,
double sampleSD,
int sampleSize,
double alpha)
Returns the final decision and p-value of a significance test, utilizing the
t-distribution.
|
static java.lang.String |
computeOneMeanTTestHaNotEqualToValue(double mu,
double sampleMean,
double sampleSD,
int sampleSize,
double alpha)
Returns the final decision and p-value of a significance test, utilizing the
t-distribution.
|
static java.lang.String |
computeOneMeanZConfInt(double mu,
double sigma,
int sampleSize,
double confidenceLevel)
Returns a
String which represents the confidence interval for a
single mean, making use of the z-distribution. |
static java.lang.String |
computeOneMeanZTestHaGreaterThanValue(double mu,
double sigma,
double sampleMean,
int sampleSize,
double alpha)
Returns the final decision (a
String ) of the significance test
for a single mean, utilizing the z-distribution. |
static java.lang.String |
computeOneMeanZTestHaLessThanValue(double mu,
double sigma,
double sampleMean,
int sampleSize,
double alpha)
Returns the final decision (a
String ) of the significance test
for a single mean, utilizing the z-distribution. |
static java.lang.String |
computeOneMeanZTestHaNotEqualToValue(double mu,
double sigma,
double sampleMean,
int sampleSize,
double alpha)
Returns the final decision (a
String ) of the significance test
for a single mean, utilizing the z-distribution. |
static java.lang.String |
computeOnePropZConfInt(double pHat,
int sampleSize,
double confidenceLevel)
Returns a
String which represents the confidence interval for
estimating a single population proportion. |
static java.lang.String |
computeOnePropZTestP0GreaterThanValue(double pHat,
double pNought,
double sampleSize,
double alpha)
Returns the final decision (a
String ) of the significance test
for a single proportion, utilizing the z-distribution. |
static java.lang.String |
computeOnePropZTestP0LessThanValue(double pHat,
double pNought,
double sampleSize,
double alpha)
Returns the final decision (a
String ) of the significance test
for a single proportion, utilizing the z-distribution. |
static java.lang.String |
computeOnePropZTestP0NotEqualToValue(double pHat,
double pNought,
double sampleSize,
double alpha)
Returns the final decision (a
String ) of the significance test
for a single proportion, utilizing the z-distribution. |
static java.util.ArrayList<java.lang.Double> |
computeOutliers(double[] inputData)
Returns a
double ArrayList containing any possible
outliers in a double array. |
static int |
computePermutations(int n,
int r)
Returns an
int which represents the number of possible
permutations, when the inputs are the n-value and the r-value. |
static double |
computeQuartile1(double[] inputData)
Returns the first quartile of a
double array, in a
double format. |
static double |
computeQuartile3(double[] inputData)
Returns the third quartile of a
double array, in a
double format. |
static double |
computeR(double[] indVar,
double[] depVar)
Returns the correlation coefficient (r-value) of the relationship between the
independent and dependent variables, in a
double format. |
static double |
computeRange(double[] inputData)
Returns the range (maximum value - minimum value) of a
double
array, in a double format. |
static double[] |
computeResidualValues(double[] indVar,
double[] depVar)
Returns a
double array containing the residual values. |
static double |
computeRowProduct(double[][] inputData,
int row)
Returns the product of the elements of a row in a 2D array (0-based index),
as a
double format. |
static double |
computeRowSum(double[][] inputData,
int row)
Returns the sum of the elements of a row in a 2D array (0-based index), as a
double format. |
static double |
computeRSquared(double[] indVar,
double[] depVar)
Returns the r^2-value of the relationship between the independent and
dependent variables, in a
double format. |
static double |
computeSe(double[] indVar,
double[] depVar)
Returns the standard error (Se) of the residuals, in a
double
format. |
static double |
computeSeb(double[] indVar,
double[] depVar)
Returns the standard error of the slope.
|
static double |
computeStandardDeviation(double[] inputData)
Returns the standard deviation of a
double array, in a
double format. |
static double |
computeSumOfResidualsSquared(double[] indVar,
double[] depVar)
Returns the sum of the residuals squared, in a
double format. |
static double |
computeSumValues(double[] inputData)
Returns the sum of the values of a
double array, in a
double format. |
static double |
computeTCDF(double lowBound,
double highBound,
int degFree)
Returns the area (probability) under the t-distribution function between two
t-values.
|
static double |
computeTPDF(double inputVal,
int degFree)
Returns the output of the Student's t-distribution function when given the
input value
and degrees of freedom.
|
static java.lang.String |
computeTwoPropZTestP1GreaterThanP2(int successes1,
int sampleSize1,
int successes2,
int sampleSize2,
double alpha)
Returns the final decision (a
String ) of the significance test
for 2 proportions, utilizing the z-distribution. |
static java.lang.String |
computeTwoPropZTestP1LessThanP2(int successes1,
int sampleSize1,
int successes2,
int sampleSize2,
double alpha)
Returns the final decision (a
String ) of the significance test
for 2 proportions, utilizing the z-distribution. |
static java.lang.String |
computeTwoPropZTestP1NotEqualToP2(int successes1,
int sampleSize1,
int successes2,
int sampleSize2,
double alpha)
Returns the final decision (a
String ) of the significance test
for 2 proportions, utilizing the z-distribution. |
static double |
computeVariance(double[] inputData)
Returns the variance of a
double array, in a double
format. |
static double[] |
computeYPredictedValues(double[] indVar,
double[] depVar)
Returns a
double array containing the predicted y-values (ŷ). |
static double |
computeZProbAvgLeftRightRiemann(double inputZLow,
double inputZHigh)
Returns the (highly accurate) probability approximation between two z-scores
for the probability density function (for normal distributions) using the
average of a left-endpoint & right-endpoint Riemann sum.
|
static double |
computeZProbLeftRiemann(double inputZLow,
double inputZHigh)
Returns the (highly accurate) probability approximation between two z-scores
for the probability density function (for normal distributions) using a
left-endpoint Riemann sum.
|
static double |
computeZProbMidpointRiemann(double inputZLow,
double inputZHigh)
Returns the probability approximation between two z-scores for the
probability density function (for normal distributions) using a midpoint
Riemann sum (accurate to about 6 decimal places).
|
static double |
computeZProbRightRiemann(double inputZLow,
double inputZHigh)
Returns the (highly accurate) probability approximation between two z-scores
for the probability density function (for normal distributions) using a
right-endpoint Riemann sum.
|
static double |
computeZProbTrapezoidRiemann(double inputZLow,
double inputZHigh)
Returns the probability approximation between two z-scores for the
probability density function (for normal distributions) using a trapezoidal
Riemann sum.
|
static double |
computeZStar(double inputConfidenceLevel)
Returns a
double which represents the z-star (z-critical) value
when a confidence level is inputted. |
static java.lang.String |
displayLSRLEquation(double[] indVar,
double[] depVar)
Returns the least-squares regression line (LSRL) equation, in a
String format. |
public static double computeMean(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeMAD(double[] inputData)
double
array, in
a double
format.
The MAD of an array is the average distance (absolute value) from each value in the array to the mean.
inputData
- a double
array.public static double computeMedian(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeMinimum(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeMaximum(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeRange(double[] inputData)
double
array, in a double
format.inputData
- a double
array.public static double computeVariance(double[] inputData)
double
array, in a double
format.inputData
- a double
array.public static double computeStandardDeviation(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeQuartile1(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeQuartile3(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeMode(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeSumValues(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static double computeIQR(double[] inputData)
double
array, in a
double
format.inputData
- a double
array.public static java.util.ArrayList<java.lang.Double> computeOutliers(double[] inputData)
double
ArrayList
containing any possible
outliers in a double
array.inputData
- a double
array.ArrayList
which contains any possible outliers in
inputData.public static int computeFactorial(int inputVal)
int
format) of an int
.inputVal
- an int
.public static int computeCombinations(int n, int r)
int
format) possible when
given the n-value and r-value (with respect to the format: nCr).n
- the n-value in the format "nCr."r
- the r-value in the format "nCr."public static double computeBinomialPdfProb(int numTrials, int xVal, double pSuccess)
double
format.numTrials
- the number of trials.xVal
- the x-value of interest.pSuccess
- the probability of success.public static double computeBinomialCdfProb(int numTrials, int inputLBound, int inputHBound, double pSuccess)
double
format.numTrials
- the number of trials.inputLBound
- the low bound x-value.inputHBound
- the high bound x-value.pSuccess
- the probability of success.public static double computeGeometricPdfProb(int xVal, double pSuccess)
double
format.xVal
- the x-value of interest.pSuccess
- the probability of success.public static double computeGeometricCdfProb(double pSuccess, int inputLowBound, int inputHighBound)
double
format.pSuccess
- the probability of success.inputLowBound
- the low bound x-value.inputHighBound
- the high bound x-value.public static double computeNormalPDF(double inputZ)
double
format) of the probability
density function (for normal distributions).
This method assumes that µ=0 and σ=1.
inputZ
- the input value.public static double computeZProbLeftRiemann(double inputZLow, double inputZHigh)
This method assumes that µ=0 and σ=1.
Enter large absolute value z-scores for the bounds, for improper integral approximation.
inputZLow
- the low bound z-score.inputZHigh
- the high bound z-score.public static double computeZProbRightRiemann(double inputZLow, double inputZHigh)
This method assumes that µ=0 and σ=1.
Enter large absolute value z-scores for the bounds, for improper integral approximation.
inputZLow
- the low bound z-score.inputZHigh
- the high bound z-score.public static double computeZProbAvgLeftRightRiemann(double inputZLow, double inputZHigh)
This method assumes that µ=0 and σ=1.
Enter large absolute value z-scores for the bounds, for improper integral approximation.
inputZLow
- the low bound z-score.inputZHigh
- the high bound z-score.public static double computeZProbMidpointRiemann(double inputZLow, double inputZHigh)
This method assumes that µ=0 and σ=1.
Enter large absolute value z-scores for the bounds, for improper integral approximation.
inputZLow
- the low bound z-score.inputZHigh
- the high bound z-score.public static double computeZProbTrapezoidRiemann(double inputZLow, double inputZHigh)
This method assumes that µ=0 and σ=1.
Enter large absolute value z-scores for the bounds, for improper integral approximation.
inputZLow
- the low bound z-score.inputZHigh
- the high bound z-score.public static double computeInverseNormalApprox(double input)
This method assumes that µ=0 and σ=1.
Method is only an approximation, and does not return an exact value.
input
- the area under the probability density function (to the left
of the desired z-score).public static int computePermutations(int n, int r)
int
which represents the number of possible
permutations, when the inputs are the n-value and the r-value.n
- the n-value in the form "nPr."r
- the r-value in the form "nPr."public static double computeDiscreteExpectedValue(double[] inputDataArray, double[] probabilitiesArray)
double
format.inputDataArray
- an array containing the possible outcomes of the
random variable.probabilitiesArray
- an array containing the probabilities of the
respective possible outcomes of the random
variable.public static double computeDiscreteVariance(double[] inputDataArray, double[] probabilitiesArray)
double
format.inputDataArray
- an array containing the possible outcomes of the
random variable.probabilitiesArray
- an array containing the probabilities of the
respective possible outcomes of the random
variable.public static double computeDiscreteStandardDeviation(double[] inputDataArray, double[] probabilitiesArray)
double
format.inputDataArray
- an array containing the possible outcomes of the
random variable.probabilitiesArray
- an array containing the probabilities of the
respective possible outcomes of the random
variable.public static double computeRowSum(double[][] inputData, int row)
double
format.inputData
- a 2D array.row
- the row of interest.public static double computeColumnSum(double[][] inputData, int col)
double
format.inputData
- a 2D array.col
- the column of interest.public static double computeRowProduct(double[][] inputData, int row)
double
format.inputData
- a 2D array.row
- the row of interest.public static double computeColumnProduct(double[][] inputData, int col)
double
format.inputData
- a 2D array.col
- the column of interest.public static double[][] computeMatrixAddition(double[][] arr1, double[][] arr2)
double
2D array containing the sum of the 2 parameter
matrices (2D arrays).
The matrices must have the same dimensions.
arr1
- a 2D array.arr2
- another 2D array.public static double[][] computeMatrixSubtraction(double[][] arr1, double[][] arr2)
double
2D array containing the difference of the 2
parameter matrices (2D arrays).
The matrices must have the same dimensions.
arr1
- a 2D array.arr2
- another 2D array.public static double[][] computeMatrixMultiplicationByScalar(double[][] arr, double scalar)
double
2D array containing the product of a matrix and
a scalar.arr
- a 2D array.scalar
- the scalar.public static double computeSe(double[] indVar, double[] depVar)
double
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeSumOfResidualsSquared(double[] indVar, double[] depVar)
double
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double[] computeResidualValues(double[] indVar, double[] depVar)
double
array containing the residual values.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double[] computeYPredictedValues(double[] indVar, double[] depVar)
double
array containing the predicted y-values (ŷ).
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeLSRLOutput(double[] indVar, double[] depVar, double input)
double
which represents the predicted y-value (ŷ) when
an x-value is inputted into the least-squares regression line (LSRL).
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.input
- a double
which is the value to be inputted into
the LSRL function.public static java.lang.String displayLSRLEquation(double[] indVar, double[] depVar)
String
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeA(double[] indVar, double[] depVar)
double
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeB(double[] indVar, double[] depVar)
double
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeR(double[] indVar, double[] depVar)
double
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeRSquared(double[] indVar, double[] depVar)
double
format.
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- a double
array containing the independent
variable values.depVar
- a double
array containing the dependent variable
values.public static double computeZStar(double inputConfidenceLevel)
double
which represents the z-star (z-critical) value
when a confidence level is inputted.
This method is only an approximation.
inputConfidenceLevel
- a double
representing the input
confidence level.public static java.lang.String computeOneMeanZConfInt(double mu, double sigma, int sampleSize, double confidenceLevel)
String
which represents the confidence interval for a
single mean, making use of the z-distribution.
This method assumes that µ=0 and σ=1.
This method is only an approximation.
mu
- the mean of the sample.sigma
- the standard deviation of the population.sampleSize
- the size of the sample.confidenceLevel
- the input confidence level.public static java.lang.String computeOneMeanZTestHaGreaterThanValue(double mu, double sigma, double sampleMean, int sampleSize, double alpha)
String
) of the significance test
for a single mean, utilizing the z-distribution.
For this method:
mu
- the population mean to be tested.sigma
- the population standard deviation.sampleMean
- the mean of the sample.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOneMeanZTestHaLessThanValue(double mu, double sigma, double sampleMean, int sampleSize, double alpha)
String
) of the significance test
for a single mean, utilizing the z-distribution.
For this method:
mu
- the population mean to be tested.sigma
- the population standard deviation.sampleMean
- the mean of the sample.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOneMeanZTestHaNotEqualToValue(double mu, double sigma, double sampleMean, int sampleSize, double alpha)
String
) of the significance test
for a single mean, utilizing the z-distribution.
For this method:
mu
- the population mean to be tested.sigma
- the population standard deviation.sampleMean
- the mean of the sample.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOnePropZConfInt(double pHat, int sampleSize, double confidenceLevel)
String
which represents the confidence interval for
estimating a single population proportion.
This method is only an approximation.
pHat
- the sample proportion.sampleSize
- the size of the sample.confidenceLevel
- the confidence level needed.public static java.lang.String computeOnePropZTestP0LessThanValue(double pHat, double pNought, double sampleSize, double alpha)
String
) of the significance test
for a single proportion, utilizing the z-distribution.
For this method:
pHat
- the sample proportion.pNought
- the population proportion to be tested.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOnePropZTestP0GreaterThanValue(double pHat, double pNought, double sampleSize, double alpha)
String
) of the significance test
for a single proportion, utilizing the z-distribution.
For this method:
pHat
- the sample proportion.pNought
- the population proportion to be tested.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOnePropZTestP0NotEqualToValue(double pHat, double pNought, double sampleSize, double alpha)
String
) of the significance test
for a single proportion, utilizing the z-distribution.
For this method:
pHat
- the sample proportion.pNought
- the population proportion to be tested.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeTwoPropZTestP1LessThanP2(int successes1, int sampleSize1, int successes2, int sampleSize2, double alpha)
String
) of the significance test
for 2 proportions, utilizing the z-distribution.
For this method:
successes1
- the number of successes in the sample, with respect to
p1.sampleSize1
- the size of the sample, with respect to p1.successes2
- the number of successes in the sample, with respect to
p2.sampleSize2
- the size of the sample, with respect to p2.alpha
- the significance level (α) of the test.public static java.lang.String computeTwoPropZTestP1GreaterThanP2(int successes1, int sampleSize1, int successes2, int sampleSize2, double alpha)
String
) of the significance test
for 2 proportions, utilizing the z-distribution.
For this method:
successes1
- the number of successes in the sample, with respect to
p1.sampleSize1
- the size of the sample, with respect to p1.successes2
- the number of successes in the sample, with respect to
p2.sampleSize2
- the size of the sample, with respect to p2.alpha
- the significance level (α) of the test.public static java.lang.String computeTwoPropZTestP1NotEqualToP2(int successes1, int sampleSize1, int successes2, int sampleSize2, double alpha)
String
) of the significance test
for 2 proportions, utilizing the z-distribution.
For this method:
successes1
- the number of successes in the sample, with respect to
p1.sampleSize1
- the size of the sample, with respect to p1.successes2
- the number of successes in the sample, with respect to
p2.sampleSize2
- the size of the sample, with respect to p2.alpha
- the significance level (α) of the test.public static double computeGammaFunction(double inputZ)
This method makes use of Stirling's approximation of the gamma function.
inputZ
- the input value.public static double computeChiSquarePDF(double chiSqrValue, int degFree)
chiSqrValue
- the input chi-square value.degFree
- the degrees of freedom.public static double computeChiSquareCDF(double lowerBound, double upperBound, int degFree)
lowerBound
- the lower bound chi-square value.upperBound
- the upper bound chi-square value.degFree
- the degrees of freedom.public static java.lang.String computeChiSquareGOFTest(double[] observed, double[] expected, double alpha)
The decision could be to either reject the null hypothesis or fail to reject the null hypothesis.
The degrees of freedom will be automatically registered as one less than the number of categories.
observed
- the array containing the observed values.expected
- the array containing the expected values.alpha
- the significance level (α) of the test.public static java.lang.String computeChiSquareTwoWayTest(double[][] observed, double alpha)
The decision could be to either reject the null hypothesis or fail to reject the null hypothesis.
The degrees of freedom will automatically be registered as (# of rows - 1) * (# of columns - 1).
observed
- the observed matrix (do not include cells for the row totals
and column
totals).alpha
- the significance level (α) of the test.public static double computeTPDF(double inputVal, int degFree)
inputVal
- the input value.degFree
- the degrees of freedom.public static double computeTCDF(double lowBound, double highBound, int degFree)
lowBound
- the lower bound t-value.highBound
- the higher bound t-value.degFree
- the degrees of freedom.public static java.lang.String computeOneMeanTTestHaLessThanValue(double mu, double sampleMean, double sampleSD, int sampleSize, double alpha)
The alternate hypothesis must state that the population mean is less than a value.
The decision could be to either reject the null hypothesis or fail to reject the null hypothesis.
The degrees of freedom will automatically be registered as one less than the sample size.
mu
- the population mean to be tested.sampleMean
- the mean of the sample.sampleSD
- the standard deviation of the sample.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOneMeanTTestHaGreaterThanValue(double mu, double sampleMean, double sampleSD, int sampleSize, double alpha)
The alternate hypothesis must state that the population mean is greater than a value.
The decision could be to either reject the null hypothesis or fail to reject the null hypothesis.
The degrees of freedom will automatically be registered as one less than the sample size.
mu
- the population mean to be tested.sampleMean
- the mean of the sample.sampleSD
- the standard deviation of the sample.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static java.lang.String computeOneMeanTTestHaNotEqualToValue(double mu, double sampleMean, double sampleSD, int sampleSize, double alpha)
The alternate hypothesis must state that the population mean is not equal to a value.
The decision could be to either reject the null hypothesis or fail to reject the null hypothesis.
The degrees of freedom will automatically be registered as one less than the sample size.
mu
- the population mean to be tested.sampleMean
- the mean of the sample.sampleSD
- the standard deviation of the sample.sampleSize
- the size of the sample.alpha
- the significance level (α) of the test.public static double computeSeb(double[] indVar, double[] depVar)
This method uses linear regression to model the relationship between the 2 variables (least-squares regression line format: ŷ = a + bx).
indVar
- the independent variable.depVar
- the dependent variable.public static java.lang.String computeLinRegTTestNegativeSlope(double[] indVar, double[] depVar, double alpha)
This method tests whether or not the population slope is negative.
The degrees of freedom will automatically be registered as 2 less than the number of data values.
indVar
- the independent variable.depVar
- the dependent variable.alpha
- the significance level (α) of the test.public static java.lang.String computeLinRegTTestPositiveSlope(double[] indVar, double[] depVar, double alpha)
This method tests whether or not the population slope is positive.
The degrees of freedom will automatically be registered as 2 less than the number of data values.
indVar
- the independent variable.depVar
- the dependent variable.alpha
- the significance level (α) of the test.public static java.lang.String computeLinRegTTestUnequalSlope(double[] indVar, double[] depVar, double alpha)
This method tests whether or not the population slope is not equal to 0.
The degrees of freedom will automatically be registered as 2 less than the number of data values.
indVar
- the independent variable.depVar
- the dependent variable.alpha
- the significance level (α) of the test.