Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Supervised Learning in R: Regression

Cursus bekijken

Oefeninstructies

  • Define a formula that expresses blood_pressure explicitly as a function of age and weight. Assign the formula to the variable fmla and print it.
  • Use fmla to fit a linear model to predict blood_pressure from age and weight in the dataset bloodpressure. Call the model bloodpressure_model.
  • Print the model and call summary() on it. Does blood pressure increase or decrease with age? With weight?

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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() 
___
___
Code bewerken en uitvoeren