Course Hero Logo

Assignment4.docx - . Assignment 4 Use Python to analyze the...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 7 pages.

.Assignment 4UsePythonto analyze the data sets associated with the two cases below. When you are done,upload this completed worksheet as a Word document (copy and paste your output andcomments where indicated). Also save and upload the .py files that contain your Python code.Your code should containcommentsabout what it does at each step. Youdo nothave toinclude your Python code on this worksheet.Refer to the Python examples that were covered in class exercises for guidance. Some of thecode can be copied and used for this assignment, but be careful to make changes whereneeded. Also refer to the slide sets for additional information that can help you answer thequestions.Scoring for this assignment will be based on correctly constructing the needed Python code andproviding the correct results, along with the quality of any comments and written responses. Besure to follow the instructions exactly and provide all information requested to receive full credit.Case 1: Which students are choosing to study STEM fields in college?There has beencontinued interest in understanding what type of students (based on demographic, aptitude, andother measures) plan to pursue undergraduate studies in fields related to science, technology,engineering, and mathematics (STEM). The CSV file “SurveyData” contains selected datacollected from 240 college-bound students just after they graduated from high school in theUnited States. The data set is comprised of the following six variables for each student:STEM: Does the student intend to pursue a STEM field of study (0 = No, 1 = Yes)GPA: student’s high school grade point average (GPA)SAT: student’s SAT scoresWhite: student is of European descent (Yes or No)Female: student is female (Yes or No)Asian: student is of Asian descent (Yes or No)Some respondents are classified as neither White nor Asian (none are classified as both).Respondents that are not classified as female are male.1A.Create alogistic regressionmodel using STEM as the response (y) variable and GPAand SAT as the predictor (x) variables. The model will predict whether a student is expectedto pursue a STEM field or not. Divide the data into training and testing data, with the testingdata size equal to 20% of the all data (use random_state=101). Create the model usingthe training data, then generate a set of predictions using the test data. Provide theintercept (b0) and coefficients (b1and b2) for the model below.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 7 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
N/A
Tags
Statistics, Type I and type II errors

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture