Multivariate linear regression (Part 1)
In this exercise, you will work with the blood pressure dataset (Source), and model blood_pressure as a function of weight and age.
The data frame bloodpressure has been pre-loaded for you.
Latihan ini adalah bagian dari kursus
Supervised Learning in R: Regression
Petunjuk latihan
- Define a formula that expresses
blood_pressureexplicitly as a function ofageandweight. Assign the formula to the variablefmlaand print it. - Use
fmlato fit a linear model to predictblood_pressurefromageandweightin the datasetbloodpressure. Call the modelbloodpressure_model. - Print the model and call
summary()on it. Does blood pressure increase or decrease with age? With weight?
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# 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()
___
___