編輯

共用方式為


WorksheetFunction.TTest(Object, Object, Double, Double) Method

Definition

Returns the probability associated with a Student's t-Test. Use TTEST to determine whether two samples are likely to have come from the same two underlying populations that have the same mean.

public:
 double TTest(System::Object ^ Arg1, System::Object ^ Arg2, double Arg3, double Arg4);
public double TTest (object Arg1, object Arg2, double Arg3, double Arg4);
Public Function TTest (Arg1 As Object, Arg2 As Object, Arg3 As Double, Arg4 As Double) As Double

Parameters

Arg1
Object

Array1 - the first data set.

Arg2
Object

Array2 - the second data set.

Arg3
Double

Tails - specifies the number of distribution tails. If tails = 1, TTEST uses the one-tailed distribution. If tails = 2, TTEST uses the two-tailed distribution.

Arg4
Double

Type - the kind of t-Test to perform.

Returns

Remarks

Important: This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. This function is still available for compatibility with earlier versions of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality. For more information about the new function, see the T_Test(Object, Object, Double, Double) method.

1Paired
2Two-sample equal variance (homoscedastic)
3Two-sample unequal variance (heteroscedastic)

If array1 and array2 have a different number of data points, and type = 1 (paired), TTest returns the #N/A error value.

The tails and type arguments are truncated to integers.

If tails or type is nonnumeric, TTest returns the #VALUE! error value.

If tails is any value other than 1 or 2, TTest returns the #NUM! error value.

TTest uses the data in array1 and array2 to compute a non-negative t-statistic. If tails=1, TTest returns the probability of a higher value of the t-statistic under the assumption that array1 and array2 are samples from populations with the same mean. The value returned by TTest when tails=2 is double that returned when tails=1 and corresponds to the probability of a higher absolute value of the t-statistic under the “same population means” assumption.

Applies to