← Back to R Course | Chapter 9: Statistics | Lesson 1 of 7

mean, median और sd

Mean, median, और sd numbers के एक group को describe करते हैं: average, middle वाला, और ये कितने spread out हैं। यह कुछ facts के साथ class test scores summarize करने जैसा है।

In this page:

  1. mean, median, sd
Syntax
r
mean(x)
median(x)
sd(x)
mean(x, na.rm = TRUE)

mean, median, sd

mean() arithmetic average compute करता है, median() middle value ढूंढता है, और sd() एक numeric vector का standard deviation compute करता है।

तीनों fundamental descriptive statistics हैं जो एक dataset का central tendency और spread summarize करने के लिए इस्तेमाल होते हैं। हर एक का एक na.rm = TRUE argument है result compute करते वक्त missing values ignore करने के लिए।

Note: अगर एक vector में NA हो, mean() default से NA return करता है -- missing values ignore करने के लिए na.rm = TRUE pass करें।

उदाहरण: mean, median, sd

markup
scores <- c(85, 90, 78, 92, 88)

cat("Mean:", mean(scores), "\n")
cat("Median:", median(scores), "\n")
cat("Std Dev:", sd(scores), "\n")
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. NA वाले एक vector पर mean(scores) call करना और NA पाना, जब आपको na.rm = TRUE चाहिए।
  2. sd() को population standard deviation से confuse करना, जब यह n - 1, sample formula इस्तेमाल करता है।
  3. कई numbers को separate arguments की तरह pass करना, जैसे mean(1, 2, 3), जो सिर्फ पहला इस्तेमाल करता है; mean(c(1, 2, 3)) इस्तेमाल करें।
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.