sem

Syntax

sem(X)

Details

Return unbiased (normalized by N-1) standard error of the mean over X .

  • If X is a matrix, calculate the standard error for each column and return a vector.

  • If X is a table, calculate the standard error of each column and return a table.

Note:

DolphinDBsemprovides the same core functionality asscipy.stats.sem. The differences are as follows:

  • DolphinDB sem supports numeric vectors, matrices, and tables. For matrices and tables, it computes by column and ignores NULL.
  • scipy.stats.sem supports axis-based computation on arrays, and by default returns NaN when it encounters NaN. You can set nan_policy="omit" to ignore NaN.
  • If the input data and missing-value handling are the same, both functions return the same results.

Parameters

X is a numeric vector/matrix/table.

Examples

[1,4,9,10,20,32].sem();
// output: 4.688046

[1,4,9,10,NULL,20,32].sem();
// output: 4.688046