axnuo

[R] 다중 회귀 분석과 상관 관계 분석 본문

Data science

[R] 다중 회귀 분석과 상관 관계 분석

axnuo 2023. 12. 14. 14:37

.libPaths("C:/Users/kde23/OneDrive/R/lib")

한글 파일 깨질 때

Sys.setlocale("LC_ALL","korean")
pac = read.table("exam302_2.txt", header = T, sep = '\\t', fill= TRUE, encoding = 'UTF-8')
#fill = 빈 입력 값 채워줌. ... 응

모델 = lrtest, step

app3=aggregate(A_calorie~A_myhealth_id,data = app2,median)

(https://analysis-flood.tistory.com/24 ) 참

library(dplyr)

dist = distinct(data, col, keep_all=T)

res = glm(diabetesC~sexC, data = data, family="binomial")

exp(res$coefficients)

 

바이너리 카테고리자나여! (y == 당뇨)

113명 중 104명 == 92프로

98명중에 75명 == 76.5프로

칼럼퍼센트는 넷째줄이져

58.1 프로랑 41.9프로 (당뇨 O)

오듀레이시오?

a b →

c d

일 때 ad / bc 할 때 OR이 나

10423 / (975)

⇒ 3.543

이걸 굳이 프리퀀시로 해야할가?

ㄴㄴ 아니당

그럼 어케 하노?

⇒ glm에 넣으면된다

ALLDATA$dang = ifelse(ALLDATA$hba1c >= 6.5, 0, 1)
res = glm(dang~sex, data = ALLDATA, family='binomial')

 

 

https://blog.naver.com/lixd289/223292511333