<jupyter_start><jupyter_text>Assignment 5, Part 2: Linear Regression PracticeAssignment 5 builds on the StreetEasy dataset we discussed in class, and looks at a few other relationships in the data.<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm

%matplotlib inline
se_df = pd.read_csv('https://grantmlong.com/data/streeteasy_rents_june2016.csv')
se_df.head()<jupyter_output><empty_output><jupyter_text>Question 1: Exploring Bedrooms and Bathrooms * Create **two** separate scatterplots showing the relations between rents and bedrooms, and rents and bathrooms.  * In two to three sentences, explain any problem this might pose for predicting rents.<jupyter_code># your code for scatterplots here<jupyter_output><empty_output><jupyter_text>--- *your written response here* ---  Question 2: Running a regression * Using `statsmodels` (and the code provided below), fit a regression with a **constant, bedrooms, bathrooms,** and **time to subway** as independent variables and **rent** as the dependent variable.  * Print the regression results.<jupyter_code># Add a constant to our existing dataframe for modeling purposes
se_df = sm.add_constant(se_df)

est = sm.OLS(se_df['rent'], 
             se_df[[XXXX, XXXX, XXXX, XXXX]]
            ).fit()

print(XXXX)<jupyter_output><empty_output><jupyter_text>Question 3: Interpreting Results * Write three sentences identifying the coefficient for each independent variable and explaining how each of the three predictors relates to rent.  * Briefly explain whether you believe each of these predictors are statistically significant and why.  --- *your written response here* ---  Question 4: Idenfitying Pitfalls* Create a scatterplot of the values for bedrooms with the values for bathrooms.* Identify which of the required assumptions for linear regression that we discussed in class is challenged by this scatterplot.<jupyter_code># your code for scatterplots here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07390648567119155, 'fraction_numerical': 0.005530417295123178, 'mean_word_length': 5.482084690553746, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '645738', 'license': 'MIT', 'n_tokens_mistral': 561, 'n_tokens_neox': 520, 'n_words': 226, 'path': 'lecture-5/Assignment-5ii.ipynb', 'repo_name': 'ExcelE/itds2018', 'size': '1989'}