

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This r tutorial explains how to find measures of central tendency, such as mean, median, trimmed mean, and midrange, using r programming language and the given test scores dataset. It also covers estimated means from a frequency table and weighted means.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!
The (>) symbol indicates something that you will type in. A bullet (•) indicates what the R program should output (and other comments).
Type: scores <- c(80, 76, 100, 83, 100) Type: scores
Type: mean(scores)
Type: sum(scores) / length(scores)
Type: mean(scores, trim=.2)
Type: median(scores)
Type: table(scores) - Look for the data value with the highest frequency.
Type: max(table(scores))
Type: which(table(scores) == max(table(scores)))
Type: min(scores) - You should see ‘76’.
Type: max(scores) - You should see ‘100’.
Type: (76+100)/ - You should see ‘88’, the midrange in points.
Type: range(scores) - You should see the min and the max of the data set. - WARNING: This is not really the “range” of the data set. We will use the term “range” to refer to a measure of spread.
Type: mean(range(scores)) - You should see ‘88’, the midrange in points.