Using R program please How do you find the standard deviatio
Using R program please. How do you find the standard deviation of each variable in the \'mtcars\' data set?
Solution
\'mtcars\' is a data frame with 32 observations on 11 variables.
Now to calculate satndard deviation we can simple use the command sd(variable_name)
To calculate the standard deviation of each variable we can use the followings-
Now it will display standard deviation of all the variables of \'mtcars\'.
Another way would be following-
>sd(mpg)
>sd(cyl)
>sd(disp)
>sd(hp)
>sd(drat)
>sd(wt)
>sd(qsec)
>sd(vs)
>sd(am)
>sd(gear)
>sd(carb)
In this way we can calculate standard deviation of all the variables of \'mtcars\'.

