ZTEST

function ZTEST(arg1: number[] | ApiRange = null, arg2: number = null, arg3: number = null): number

Description

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

Parameters

arg1number[] | ApiRangedefault: null

The array or range of data against which to test X.

arg2numberdefault: null

The value to test.

arg3numberdefault: null

The population (known) standard deviation. If omitted, the sample standard deviation is used.

Returns

number

Try It



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

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

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

// Calculate the TRIMMEAN of the range A1:A16
var oFunction = Api.GetWorksheetFunction();
var result = oFunction.ZTEST(data, 0.4);
oWorksheet.GetRange("B1").SetValue(result);


Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).