다변량 선형 회귀 (1)
이번 연습 문제에서는 혈압 데이터셋(Source)을 사용해, blood_pressure를 weight와 age의 함수로 모델링해 보겠습니다.
데이터 프레임 bloodpressure는 미리 불러와 두었습니다.
이 연습은 강의의 일부입니다
R로 하는 Supervised Learning: 회귀
연습 안내
blood_pressure를age와weight의 함수로 명시적으로 표현하는 수식을 정의하세요. 수식을 변수fmla에 할당하고 출력하세요.fmla를 사용해 데이터셋bloodpressure에서age와weight로blood_pressure를 예측하는 선형 모델을 적합하세요. 모델 이름은bloodpressure_model로 하세요.- 모델을 출력하고
summary()를 호출하세요. 나이가 들수록, 체중이 늘수록 혈압은 증가하나요, 감소하나요?
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# bloodpressure is available
summary(bloodpressure)
# Create the formula and print it
fmla <- ___
___
# Fit the model: bloodpressure_model
bloodpressure_model <- ___
# Print bloodpressure_model and call summary()
___
___