tTest#

swordfish.function.tTest()#

If Y is not specified, conduct a one-sample t-test on X. If Y is specified, conduct a paired-sample t-test on X and Y.

Parameters:
  • X (Constant) – A numeric vector indicating the sample for the t-test.

  • Y (Constant, optional) – A numeric vector indicating the second sample for a paired-sample t-test, by default DFLT

  • mu (Constant, optional) – A floating number, by default DFLT. If Y is not specified, mu is the mean v alue of X in the null hypothesis; if Y is specified, mu is the difference in the mean values of X and Y in the null hypothesis.

  • confLevel (Constant, optional) – A floating number between 0 and 1 indicating the confidence level of the test, by default DFLT

  • equalVar (Constant, optional) – A Boolean value indicating whether the variance of X and Y are the same in the null hypothesis, by default DFLT.

Returns:

Return a dictionary with the following keys:

  • stat: a table with p-value and confidence interval under 3 alternative hypotheses.

  • df: degree of freedom

  • confLevel: confidence level

  • method: type of t-test used

  • tValue: t-stat

Return type:

Constant