Home Database Mysql Tutorial SQL Server 下取中位数(中位值)的方法

SQL Server 下取中位数(中位值)的方法

Jun 07, 2016 pm 05:20 PM
sql server

将数据排序后,位置在最中间的数值。即将数据分成两部分,一部分大于该数值,一部分小于该数值。中位数的位置:当样本数为奇数时

  中位数是指将数据按大小顺序排列起来,形成一个数列,居于数列中间位置的那个数据。中位数用Me表示。

  从中位数的定义可知,所研究的数据中有一半小于中位数,一半大于中位数。中位数的作用与算术平均数相近,也是作为所研究数据的代表值。在一个等差数列或一个正态分布数列中,中位数就等于算术平均数。

  在数列中出现了极端变量值的情况下,用中位数作为代表值要比用算术平均数更好,因为中位数不受极端变量值的影响;如果研究目的就是为了反映中间水平,当然也应该用中位数。在统计数据的处理和分析时,可结合使用中位数。

  将数据排序后,位置在最中间的数值。即将数据分成两部分,一部分大于该数值,一部分小于该数值。中位数的位置:当样本数为奇数时,中位数=(N+1)/2 ; 当样本数为偶数时,中位数为N/2与1+N/2的均值 ,,或求出中间两个数的平均数作为中位数。

  在Excel中有函数MEDIAN来取中位数,但是在SQL Server中则没有该内置的函数,需要用以下方法求得。

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

Hot Article

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What software is microsoft sql server? What software is microsoft sql server? Feb 28, 2023 pm 03:00 PM

What software is microsoft sql server?

PHP and SQL Server database development PHP and SQL Server database development Jun 20, 2023 pm 10:38 PM

PHP and SQL Server database development

SQL Server or MySQL? New research reveals the best database choices. SQL Server or MySQL? New research reveals the best database choices. Sep 08, 2023 pm 04:34 PM

SQL Server or MySQL? New research reveals the best database choices.

How to connect to a Microsoft SQL Server database using PDO How to connect to a Microsoft SQL Server database using PDO Jul 29, 2023 pm 01:49 PM

How to connect to a Microsoft SQL Server database using PDO

SQL Server and MySQL compete, how to choose the best database solution? SQL Server and MySQL compete, how to choose the best database solution? Sep 10, 2023 am 08:07 AM

SQL Server and MySQL compete, how to choose the best database solution?

A brief analysis of five methods of connecting SQL Server with PHP A brief analysis of five methods of connecting SQL Server with PHP Mar 21, 2023 pm 04:32 PM

A brief analysis of five methods of connecting SQL Server with PHP

SQL Server vs. MySQL: Which database is more suitable for high availability architecture? SQL Server vs. MySQL: Which database is more suitable for high availability architecture? Sep 10, 2023 pm 01:39 PM

SQL Server vs. MySQL: Which database is more suitable for high availability architecture?

SQL Server vs. MySQL comparison: Which one is better for large-scale data processing? SQL Server vs. MySQL comparison: Which one is better for large-scale data processing? Sep 09, 2023 am 09:36 AM

SQL Server vs. MySQL comparison: Which one is better for large-scale data processing?

See all articles