开始使用免费开始使用

拟合频率学派线性回归

请使用 Spotify 的歌曲数据练习创建线性模型。这样可以为后续与贝叶斯模型进行比较建立一个基线。songs 数据集已为您加载。

本练习是课程的一部分

使用 rstanarm 进行贝叶斯回归建模

查看课程

练习说明

  • 创建线性模型 lm_model,用于根据歌曲年龄预测歌曲热度。
  • 打印该线性模型的摘要。
  • 使用 broom 包只查看系数。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Create the model here
lm_model <- lm(___ ~ ___, data = ___)

# Produce the summary
___(lm_model)

# Print a tidy summary of the coefficients
___(lm_model)
编辑并运行代码