官术网_书友最值得收藏!

Central tendency

There are three descriptive measures of central tendency—the mean, the median, and the mode, but SQL Server does not have a way to calculate anything other than the mean directly. The arithmetic mean, or simply the mean (there are more types of mean in the central tendency), is the sum of all measurements divided by the number of observations in the dataset. The median is the middle value that separates the higher half from the lower half of the dataset. The median and the mode are the only measures of the central tendency that can be used for ordinal data, in which values are ranked relative to one another but are not measured absolutely. The mode is the most frequent value in the dataset. This is the only central tendency measure that can be used with nominal data, which has purely qualitative category assignments. For looking into such values with SQL Server, we will either need to define our own assembly with a custom aggregate or use complex T-SQL constructs to bypass the missing statistical functions. Another option would be to use the Python code or the R code; the code can be running inside the SQL Server, and you can pass the result set as the argument to the Python code or the R code to work on the descriptive statistics.

主站蜘蛛池模板: 乡宁县| 六枝特区| 庆云县| 稻城县| 古田县| 乡城县| 富民县| 彭州市| 拉萨市| 樟树市| 开鲁县| 台东县| 浮梁县| 江北区| 政和县| 汶川县| 上虞市| 湟中县| 定远县| 韩城市| 西乌珠穆沁旗| 依安县| 新绛县| 崇仁县| 上林县| 沿河| 新沂市| 昌平区| 阿鲁科尔沁旗| 望城县| 绥德县| 穆棱市| 新昌县| 绥芬河市| 伊宁县| 淄博市| 共和县| 历史| 新邵县| 平潭县| 来宾市|