Skip to main content

Z_TEST

Returns the one-tailed P-value of a z-test.

Syntax

expression.Z_TEST(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1Requirednumber[] | ApiRangeThe array or range of data against which to test X.
arg2RequiredApiRange | ApiName | numberThe value to test.
arg3OptionalApiRange | ApiName | numberThe population (known) standard deviation. If omitted, the sample standard deviation is used.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let argumentsArr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];

// Place the numbers in cells
for (let i = 0; i < argumentsArr.length; i++) {
worksheet.GetRange("A" + (i + 1)).SetValue(argumentsArr[i]);
}

// Get values from the range
let data = worksheet.GetRange("A1:A16");

// Calculate the TRIMMEAN of the range A1:A16
let func = Api.GetWorksheetFunction();
let result = func.Z_TEST(data, 4);
worksheet.GetRange("B1").SetValue(result);