R Instructions: Standard Deviation

To open R with the dataset preloaded, right-click here and choose "Save Target As" to download the file to your computer. Then find the downloaded file and double-click it to open it in R.

The data have been loaded into the variable ratings which has three variables (column titles) Class.I, Class.II, and Class.III. Enter the command ratings to see the data.

Now you can calculate the standard deviations for each variable with the command:

sapply(ratings, sd)

Note: Using R - Notice that R understands that your three columns represent different data sets with different names, and R computes the standard deviations of the three data sets separately. The above code can easily be modified for other commands for descriptive statistics such as mean or median. If the data frame is formatted differently, consider the aggregate() function instead of sapply().