Computing the Sample Standard Deviation with R

Description

The following R command calculates the sample standard deviation of Babe Ruth's career homers for each season that he played in major league baseball. The sample standard deviation is defined as

(1)
\begin{align} \sqrt{\frac{\sum\limits_{i=1}^{n} (x_i - \bar{x})^2}{n-1}}. \end{align}

To use R in a Sage cell, the language must be set to R. See https://github.com/sagemath/sagecell/blob/master/doc/embedding.rst for details.

Sage Cell

Code

ruth <- c(22, 25, 34, 35, 41, 41, 46, 46, 46, 47, 49, 54, 54, 59, 60)
sd(ruth)

Options

None

Tags

Primary Tags: Statistics: Exploratory data analysis/descriptive statistics

Secondary Tags: Exploratory data analysis/descriptive statistics: Summary statistics

Related Cells

Attribute

Permalink:

Author: T. Judson

Date: 08 Apr 2019 17:20

Submitted by: Tom Judson

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License