MicroStrategy ONE

ChiSquareTest (Chi-Square Test for Goodness of Fit)

Returns the result of a test for goodness of fit. This function returns the chi-squared distribution for a statistical value and its associated degrees of freedom to determine, for example, to what extent an experiment verifies hypothesized results.

Decision Reality: H0 is correct Reality: H1 is correct

Accept H0

No problem

Type 1 error

Reject H0

Type 2 error

No problem

Definition

P-value is a probability of making a Type 2 error.

ChiSquareTest returns the p-value for the hypothesis test in the following form:

  • H0: Argument1 and Argument2 come from the same distribution.
  • H1: Argument1 and Argument2 come from different distributions.

Syntax

ChiSquareTest(Argument1, Argument2)

Where:

Argument1 is a fact or metric representing a list of values that contains observed values, which are to be tested against expected values.

Argument2 is a fact or metric representing a list of expected values, which are compared against the observed values provided by Argument1.

Usage Notes

This function returns the probability for a chi-squared (x2) statistic and its associated degrees of freedom (df).

This function results in an invalid value if Argument1 and Argument2 have a different number of data points. Meaning, each observed value must have an expected value to be compared to.