T'SPACE

다채로운 에디터들의 이야기

컴퓨터공학/ADsP

ADsP 데이터 분석 준 전문가 정리 10

Tonny Kang 2024. 7. 16. 10:48
반응형

https://tonnykang.tistory.com/267

 

ADsP 데이터 분석 준 전문가 정리 9

https://tonnykang.tistory.com/266 ADsP 데이터 분석 준 전문가 정리 8https://tonnykang.tistory.com/265 데이터 준 분석가 R언어 기초https://tonnykang.tistory.com/264 ADsP 데이터 분석 준 전문가 정리 6분석 준비도기업의

tonnykang.tistory.com

 

상관 분석 Correlation Analysis


피어슨 상관분석 (선형적 상관관계)


Pearson’s Correlation Analysis

피어슨 상관계수는 모수적 방법의 하나로

두 변수가 모두 정규분포를 따른다는 가정이 필요하다

> X <- c(1, 2, 3, 4, 5)
> Y <- c(3, 6, 4, 9, 8)
>cor( X, Y, method = 'pearson')
[1] 0.8062258

스피어만 상관분석(비선형적 상관관계)


Spearman’s Correlation Analysis

측정된 두 변수들이 서열척도일 때 사용하는 상관계수다

스피어만 상관계수는 비모수적 방법으로 관측값의 순위에 대하여 상관계수를 계산하는 방법이다

> X <- c(1, 2, 3, 4, 5)
> Y <- c(3, 6, 4, 9, 8)
>cor( X, Y, method = 'spearman')
[1] 0.8

상관분석 실습 R언어


10명의 학생들에 대한 학습 시간과 시험 점수에 대한 데이터가 주어졌다

학습시간과 시험 점수 사이에 상관관계가 존재하는지 알아보자

> time <- c(8, 6, 7, 3, 2, 4, 2, 7, 2, 3)
> score <- c(33, 22, 18, 6, 23, 10, 9, 30, 11, 13)
> cor.test( time, score)

Pearson's Product-Moment Correlation

data: time and score
t = 3.0733, df = 8, p-value = 0.01527
alternative hypothesis : true correlation is not equal to 0
95 percent confidence interval:
    0.1978427 0.9331309
sample estimates:
cor
0.7358112
  • p-value 값이 유의수준 0.05 보다 작으므로 귀무가설을 기각한다
  • 두 변수의 상관계수 추정치 (cor)는 0.7358112
  • 두 변수 간 (time, score) 상관관계가 있다고 통계적으로 말할 수 있다

https://tonnykang.tistory.com/269

 

ADsP 데이터 분석 준 전문가 정리 11

https://tonnykang.tistory.com/268 ADsP 데이터 분석 준 전문가 정리 10https://tonnykang.tistory.com/267 ADsP 데이터 분석 준 전문가 정리 9https://tonnykang.tistory.com/266 ADsP 데이터 분석 준 전문가 정리 8https://tonnykang.

tonnykang.tistory.com

 

반응형