# How to perform OLS when available independent variables differ between data points?

I would like to investigate the relationship between high school grades for different subjects and university credits earned in the first year. I plan to use multiple linear regression (OLS). I have data on the average grades of students in several subjects (that is, the average grade per subject, per student) and the credits earned by those students in their first year of university.

The problem however is that by far most students do not follow all subjects. For example, some follow history, some don't, some follow math 1, some follow math 2, some follow both. This means I can't construct a matrix $X$ that contains all average grades per subject per student, to perform the regression with, because I would have 'missing' values in almost all rows.

How should I deal with this?

Deleting all students that don't follow all subjects would leave me with very few data points and is probably not very representative of the general population of students.

Googling has led me to data imputation, would that be a good idea here? If so, how can I do this and what method should I apply?

• What does it mean to "follow" a subject? To write a course in high school then write it again (or a similar course) in college? – AdamO Jan 10 '18 at 14:49
• @AdamO: Following a subject is only about high school, I'm not actually interested in the grades or specific courses in university. – Dasherman Jan 10 '18 at 22:07
• I think you've missed my question. You need to define your terminology to obtain useful answers. We don't know in what sense people have been "followed" – AdamO Jan 10 '18 at 22:46
• I think "follow" means "take". – Peter Flom Jan 11 '18 at 12:31

## 1 Answer

I would argue that data imputation is not a good approach in this case because the data are missing by design, not because we lack information about the values of the variables. This creates problems with both the interpretation of the imputed values as well as meeting the assumptions needed to impute that data.

I would advise to first aggregate or reduce the number of variables in your model. You can do this based on theoretical grounds, or use dimension reduction techniques, such as factor analysis, to try to tease out latent abilities (math skills, verbal fluency etc.) that grades in different subjects are likely reflect.

Next you can and then use them in the model of your choice, if you have data about which schools the students attended then probably a mixed model would be appropriate, or if your data is applicable to OLS regression, use that.

• Just to elaborate a bit on imputation: when you impute, you are saying that the student took math 2, but we don't know her score, so we estimate it from the other data in our dataset. What actually happened was that she did not take math 2. I totally agree, @Dasherman shouldn't impute data. – Weiwen Ng Jan 10 '18 at 15:42