Question: R Programming After importing an excel file, how would I calculate the standard deviation of multiple columns. So, for example, if I had an excel

R Programming

After importing an excel file, how would I calculate the standard deviation of multiple columns. So, for example, if I had an excel file and my columns pertained to different classes and their exams on score, such as Class 1, Class 2, Class 3, Class 4, Class 5, etc.. and there were 50 students thus meaning 50 scores for each class. How would I calculate the total standard deviation in R Programming for Columns (Class 1 to Class 5)? I did this in R Programming but keep getting the standard deviation for each individual column but I want to total combined standard deviation of all the columns. For example, in this example, I do not want the standard deviations for Class 1, Class 2, Class 3, etc. but the standard deviations for Class 1 to Class 5 combined.

In R Programming, for my program I used this function which provides me the standard deviation for each column but I want the standard deviation for Columns Class1 to Class 5.

This is what I used sapply(data[,3:11], sd,na.rm=TRUE)

This gives me the standard deviation for each separate column. What would I add or change to get the total standard deviation for columns 3 to 11. I just want one standard deviation for all those columns together.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!