sd()

sd()

 The sd() function computes the standard deviation of a variable.

Example:

# Calculate the standard deviation of Thumb
sd(Fingers$Thumb)

# Alt: use 'data =' argument instead of '$' (produces same output)
sd(~Thumb, data = Fingers)

Example output:
Output of sd() function for Thumb

    • Related Articles

    • xpnorm()

      The xpnorm() function will generate the probability and z-score for a value (X) based on the mathematical function for a normal distribution. It can do this with just three pieces of information: the border you are interested in, and the mean and ...
    • gf_dist()

      The gf_dist() function can graphically overlay a number of different mathematical probability distributions. If we want to overlay the normal distribution, we’ll have to specify that with the argument “norm”, and then enter in the mean and standard ...
    • zscore()

      The function zscore() will standardize a variable by converting all of its values to z-scores (i.e., the number of standard deviations the score is above or below the mean). Example 1: Using the zscore() function alone will produce a list of z-scores ...
    • do()*

      The do()* function runs one or more lines of code the number of times specified inside the parentheses and returns the results as a data frame. Example 1: # take a random sample (n=10) of a variable, with replacement, # and calculate the standard ...
    • sampling distribution of means (SDoM)

      Sampling distribution of means (SDoM) is a distribution made up of the means of many samples.