Use import sys. Use the german_credit_data.csv file to complete the following assignment. Create a file, german.py, that loads the .csv file and runs a regression predicting credit amount from age and duration, in that order. Add a constant using sm.add_constant(data). You will need to rename the column 'Credit amount' and should change it to 'Credit_amount'. Note: you will not need to upload the .csv to CodeGrade because I have pre-loaded it. Then, print the parameters and R-squared to 2 decimals using print(model.params.round(2)) print(model.rsquared.round(2))
Use import sys. Use the german_credit_data.csv file to complete the following assignment. Create a file, german.py, that loads the .csv file and runs a regression predicting credit amount from age and duration, in that order. Add a constant using sm.add_constant(data). You will need to rename the column 'Credit amount' and should change it to 'Credit_amount'. Note: you will not need to upload the .csv to CodeGrade because I have pre-loaded it. Then, print the parameters and R-squared to 2 decimals using print(model.params.round(2)) print(model.rsquared.round(2))
Chapter5: Working With Excel Tables, Pivottables, And Pivotcharts
Section: Chapter Questions
Problem 11RA
Related questions
Question
- Use import sys. Use the german_credit_data.csv file to complete the following assignment. Create a file, german.py, that loads the .csv file and runs a regression predicting credit amount from age and duration, in that order. Add a constant using sm.add_constant(data). You will need to rename the column 'Credit amount' and should change it to 'Credit_amount'. Note: you will not need to upload the .csv to CodeGrade because I have pre-loaded it.
- Then, print the parameters and R-squared to 2 decimals using
print(model.params.round(2))
print(model.rsquared.round(2))
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage