开始使用免费开始使用

多元线性回归(第 1 部分)

在本练习中,您将使用血压数据集(来源),并将 blood_pressure 建模为 weightage 的函数。

数据框 bloodpressure 已为您预加载。

本练习是课程的一部分

R 中的监督学习:回归

查看课程

练习说明

  • 定义一个公式,将 blood_pressure 明确表示为 ageweight 的函数。将该公式赋给变量 fmla 并打印。
  • 使用 fmla 在数据集 bloodpressure 中拟合线性模型,以 ageweight 预测 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() 
___
___
编辑并运行代码