fstats_hypothesis Module



Contents


Interfaces

public interface confidence_interval

Computes the confidence interval for the specified distribution.

See Also

  • private pure function confidence_interval_scalar(dist, alpha, s, n) result(rst)

    Computes the confidence interval for the specified distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: dist

    The distribution object defining the probability distribution to establish the confidence level.

    real(kind=real64), intent(in) :: alpha

    The probability value of interest. For instance, use a value of 0.05 for a confidence level of 95%.

    real(kind=real64), intent(in) :: s

    The sample standard deviation.

    integer(kind=int32), intent(in) :: n

    The number of samples in the data set.

    Return Value real(kind=real64)

    The result.

  • private pure function confidence_interval_array(dist, alpha, x) result(rst)

    Computes the confidence interval for the specified distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: dist

    The distribution object defining the probability distribution to establish the confidence level.

    real(kind=real64), intent(in) :: alpha

    The probability value of interest. For instance, use a value of 0.05 for a confidence level of 95%.

    real(kind=real64), intent(in) :: x(:)

    An N-element array containing the data to analyze.

    Return Value real(kind=real64)

    The result.


Functions

public pure function sample_size(dist, var, delta, bet, alpha) result(rst)

Estimates the sample size required to achieve an experiment with the desired power and significance levels to ascertain the desired difference in parameter.

Read more…

Arguments

Type IntentOptional Attributes Name
class(distribution), intent(in) :: dist

The distribution to utilize as a measure.

real(kind=real64), intent(in) :: var

An estimate of the population variance.

real(kind=real64), intent(in) :: delta

The parameter difference that is desired.

real(kind=real64), intent(in), optional :: bet

The desired power level. The default for this value is 0.2, for a power of 80%.

real(kind=real64), intent(in), optional :: alpha

The desired significance level. The default for this value is 0.05 for a confidence level of 95%.

Return Value real(kind=real64)

The minimum sample size requried to achieve the desired experimental outcome.


Subroutines

public subroutine bartletts_test(x, stat, p)

Computes Bartlett's test statistic and associated probability.

Read more…

Arguments

Type IntentOptional Attributes Name
type(array_container), intent(in), dimension(:) :: x

The arrays of data to analyze.

real(kind=real64), intent(out) :: stat

The Bartlett's test statistic.

real(kind=real64), intent(out) :: p

The probability value that the variances of each data set are equivalent. A low p-value, less than some significance level, indicates a non-equivalance of variances.

public subroutine f_test(x1, x2, stat, p, dof1, dof2)

Computes the F-test and returns the probability (two-tailed) that the variances of two data sets are not significantly different.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x1(:)

An N-element array containing the first data set.

real(kind=real64), intent(in) :: x2(:)

An M-element array containing the second data set.

real(kind=real64), intent(out) :: stat

The F-statistic.

real(kind=real64), intent(out) :: p

The probability value that the two samples are likely to have come from the two underlying populations that have the same variance.

real(kind=real64), intent(out) :: dof1

A measure of the degrees of freedom.

real(kind=real64), intent(out) :: dof2

A measure of the degrees of freedom.

public subroutine levenes_test(x, stat, p, err)

Computes Levene's test statistic and associated probability.

Read more…

Arguments

Type IntentOptional Attributes Name
type(array_container), intent(in), dimension(:) :: x

The arrays of data to analyze.

real(kind=real64), intent(out) :: stat

The Bartlett's test statistic.

real(kind=real64), intent(out) :: p

The probability value that the variances of each data set are equivalent. A low p-value, less than some significance level, indicates a non-equivalance of variances.

class(errors), intent(inout), optional, target :: err

public subroutine t_test_equal_variance(x1, x2, stat, p, dof)

Computes the 2-tailed Student's T-Test for two data sets of assumed equivalent variances.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x1(:)

An N-element array containing the first data set.

real(kind=real64), intent(in) :: x2(:)

An M-element array containing the second data set.

real(kind=real64), intent(out) :: stat

The Student-'s T-Test statistic.

real(kind=real64), intent(out) :: p

The probability value that the two samples are likely to have come from two underlying populations that have the same mean.

real(kind=real64), intent(out) :: dof

The degrees of freedom.

public subroutine t_test_paired(x1, x2, stat, p, dof, err)

Computes the 2-tailed Student's T-Test for two paired data sets.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x1(:)

An N-element array containing the first data set.

real(kind=real64), intent(in) :: x2(:)

An N-element array containing the second data set.

real(kind=real64), intent(out) :: stat

The Student-'s T-Test statistic.

real(kind=real64), intent(out) :: p

The probability value that the two samples are likely to have come from two underlying populations that have the same mean.

real(kind=real64), intent(out) :: dof

The degrees of freedom.

class(errors), intent(inout), optional, target :: err

A mechanism for communicating errors and warnings to the caller. Possible warning and error codes are as follows. - FS_NO_ERROR: No errors encountered. - FS_ARRAY_SIZE_ERROR: Occurs if x1 and x2 are not the same length.

public subroutine t_test_unequal_variance(x1, x2, stat, p, dof)

Computes the 2-tailed Student's T-Test for two data sets of assumed non-equivalent variances.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x1(:)

An N-element array containing the first data set.

real(kind=real64), intent(in) :: x2(:)

An M-element array containing the second data set.

real(kind=real64), intent(out) :: stat

The Student-'s T-Test statistic.

real(kind=real64), intent(out) :: p

The probability value that the two samples are likely to have come from two underlying populations that have the same mean.

real(kind=real64), intent(out) :: dof

The degrees of freedom.