It returns a data array except for `var` and `sd`, which return a dataset. The reason is that `weights` is a dataset.