General Statistics Calculator
Note: This GIF shows how to copy snippets to your dashboard so that you can use them and customize them to fit your needs.
This General Statistics Calculator takes a data set of numbers and generates useful information about the data set and displays a graph of all the items in the data set.
General Statistics Calculator
{formparagraph: name=array; default=21, 37, 34, 32, 2, 19, 12; trim=yes; cols=50}
{if: {=catch(average(split(array, ",")), "error")} <> "error"}
{Listcount=count(SortedList)} {SortedList=sort(split(array, ","), (a, b) -> (a - b)); trim=yes} {Mean=average(SortedList); trim=yes} {Largest=SortedList[listcount]; trim=yes} {Smallest=SortedList[1]; trim=yes} {StandardDeviationPop={=sqrt({=sum([(x-Mean)^2 for x in SortedList])} / Listcount)}; trim=yes} {StandardDeviationSam={=sqrt({=sum([(x-{=average(SortedList)})^2 for x in SortedList])} / (listcount-1))}; trim=yes}
Count = {=Listcount}
Sum = {=sum(SortedList)}
Mean = {=Mean; format=.3r}
Median = {=median(SortedList); format=.3r}
Largest = {=Largest}
Smallest = {=Smallest}
Range = {=Largest-Smallest}
Standard Deviation = {formmenu: name=PopSam; default=Population; Sample} {if: PopSam = "Population"}{=StandardDeviationPop; format=.3r}{else}{=StandardDeviationSam; format=.3r}{endif}
{image: https://quickchart.io/chart/chart?width=600&height=300&c={type: 'bar',data: {labels: {=split(array, ",")},datasets: [{label: 'Dataset 1',data: {=split(array, ",")},}],},options: {legend: {display: false,},scales: {xAxes: [{display: true,gridLines: {display: false,},}],},},}}
{else}
{error: please enter in the text field above in the correct format, "1, 2, 3, ..., n"}
{endif}
What is Count?
The Count is a total number of items in the data set.
What is Sum?
The Sum is the total value of all the items in the data set added up.
What is Mean?
The Mean is the total value of all the items in the data set added up divided by the total number of items. The Mean is sometimes referred to as the average.
What is Median?
The Median is the value in the middle of the data set when it is arranged in ascending or descending order. If the data set has an even number of items then the Median will be the average of the two middle items.
What is Standard Deviation?
Standard Deviation is the average distance from each item from the Mean of the data set. The formula for Standard Deviation is the square root of the sum of squared differences from the Mean divided by the number of items in the data set for popluation, while with sample it is divided by the number of items in the data set minus one.