1. LON-CAPA Logo
  2. Help
  3. Log In
 

Browsing resource, all submissions are temporary.


Predicting Grades

The data containing the scores of the Final, Exam average, HW average and Bonus of a U of I course in Fall 2015 semester (provided by the instructor of the course) can be downloaded here and then loaded to R using the command

grade <- read.csv("Grades_Fall2015.csv")

The last column, named 'y', in the data is a 0/1 integer indicating whether the student got an A or A+ (y=1) or below A (y=0). Some students are very concerned about whether they will get an A in a course, but they can know for sure only after all the scores are available. Here you will construct a model to predict whether a student will get an A or A+ in the course based on the average Exam and HW scores only.

a. Fit a logistic regression model predicting the probability P(y=1) from HW and Exams. Ignore the "glm.fit: fitted probabilities numerically 0 or 1 occurred" warning message. It just tells you that some of the predicted probabilities are too close to 0 or 1 that R has to round the numbers to 0 or 1. This is because R, as well as most other programming languages, uses 8 bytes to store a numeric value, which means that a real number can only be represented to an accuracy of about 16 digits.

Calculate McFadden's R2 from the summary output. Enter the value to 3 decimal places.

McFadden's R2 =

 Tries 0/3

b. For this particular course, HW counts 15% and Exams count 60%. Create a new column in the data frame named 'x'. Set x to the weighted average of HW and Exams according to the formula x = (15*HW + 60*Exams)/75. Then fit a logistic regression model predicting the probability P(y=1) from x alone. Enter the coefficients and McFadden's R2 to 3 decimal places.

ln(odds) = + x

 Tries 0/5

McFadden's R2 =

 Tries 0/3

The rest of questions will show up after you finish part (b)