3
$\begingroup$

I'm using Stata 14.1 to do a regression, and I got a matsize too small error. It gave some more output to tell me possible reasons for this problem, and I think this was the reason that applied to me

If you are using factor variables and included an interaction that has
lots of missing cells, either increase matsize or set emptycells drop to
reduce the required matrix size; see help set emptycells.

Yes, I am using factor variables (one for each state in the US and Washington DC), and yes there are a lot of empty cells.

I'm trying to figure out which option is better, drop empty cells or increase the matrix size so it can include all the factor variables.

It has help articles on how to do both of those things: drop empty cells or increase matsize. It's not the "how" but the "why" that I'm trying to figure out. What happens mathematically when I drop empty cells? (I probably won't understand the math, so if there's a dumbed down answer just about whether it's good or bad to leave off empty cells, that would probably be better.)

$\endgroup$
0
$\begingroup$

When you have empty cells (and by empty cells, I assume that you are referring to a missing value of an observation specific variable), then STATA by default drops the entire row. So in a sense, even when you have a single missing value on a variable and you have say 100 variables, you lose the whole row (the entire observation). This is by default. If you want to avoid this, perhaps think about imputing the missing data points.

$\endgroup$
  • $\begingroup$ But as far as the results go, am I risking more bias? Is it any less valid? Etc? $\endgroup$ – user4207 Dec 18 '15 at 6:53
0
$\begingroup$

To answer "WHY", if you have a lot of empty cells then one reason may be that when STATA drops the corresponding rows, you end up with fewer observations (rows) than features (x's). Intuitively, you might think of it like this: each observation is able to explain one "fact". Each of the coefficients in your model is a fact about how your x's influence your y. If you have fewer observations than x's, you cannot explain all of your facts.

Depending on what you're doing, you could resort to model selection techniques to pare down the number of features (if your model isn't following directly from theory and you have lots of features). Regularization techniques (e.g., standardization) are also possible, but will change the interpretation of your co-efficients and you may lose explainability of your results. Otherwise, you need to impute values for the missing cells as noted in @ChinG's answer.

Not sure how you would plan to "increase the matrix size" -- unless this entails gathering more observations, it would not be the right thing to do.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy