Returns the one-tailed P-value of a z-test.
Name | Type | Description |
arg1 | Array.<number> | ApiRange | The array or range of data against which to test X. |
arg2 | number | The value to test. |
arg3 | number | The population (known) standard deviation. If omitted, the sample standard deviation is used. |
builder.CreateFile("xlsx"); 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); builder.SaveFile("xlsx", "ZTEST.xlsx"); builder.CloseFile();