cor() का उपयोग
cor measure करता है कि numbers के दो sets कितनी strongly साथ move करते हैं, जैसे क्या लंबे बच्चों के shoes बड़े होते हैं। Answer minus one से one तक चलता है।
In this page:
Syntax
cor(x, y)
cor()
cor(x, y) दो numeric vectors के बीच Pearson correlation coefficient compute करता है, -1 और 1 के बीच एक value describe करते हुए ये linearly कितनी strongly साथ move करते हैं।
1 के पास एक value strong positive correlation मतलब है, -1 के पास strong negative correlation, और 0 के पास थोड़ा linear relationship। यह variables के बीच relationships explore करने के लिए एक foundational tool है।
Note:
0 के पास एक correlation मतलब यह नहीं कि कोई relationship नहीं -- इसका मतलब सिर्फ यह है कि कोई linear relationship नहीं है।
उदाहरण: cor()
x <- c(1, 2, 3, 4, 5)
y <- c(2, 4, 6, 8, 10)
cat("Correlation:", cor(x, y), "\n")
Login to try C/C++/Java/PHP code in the editor
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. #}
आम गलतियां
cor(x, y)को इस proof की तरह पढ़ना किx,ycause करता है, जब correlation cause नहीं दिखाता।- अलग lengths के vectors pass करना, जो एक error देता है।
use = "complete.obs"के बिनाNAवाले data परcor()इस्तेमाल करना, जोNAreturn करता है।
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: