1. सीखें
  2. /
  3. प्रोजेक्ट्स
  4. /
  5. Case Study: Exploratory Data Analysis in R

Connected

अभ्यास

Linear regression on the United States

A linear regression is a model that lets us examine how one variable changes with respect to another by fitting a best fit line. It is done with the lm() function in R.

Here, you'll fit a linear regression to just the percentage of "yes" votes from the United States.

निर्देश

100 XP
  • Print the US_by_year data to the console.
  • Using just the US data in US_by_year, use lm() to run a linear regression predicting percent_yes from year. Save this to a variable US_fit.
  • Summarize US_fit using the summary() function.