By default, Stata only allocates enough memory for up to 40 predictors. Even small ANOVA or regression models can exceed this limit when you include interaction terms or dummy variables. You can increase the matsize to permit up to 200 variables as shown below.too many variables or values (matsize too small) r(146);
Keep increasing the value of matsize until you no longer get the error above. The value of matsize you choose lasts as long as your Stata session, and would need to be set again if you quit Stata. Or, you can use the permanently option and the value will be remembered even after you close and restart Stata, for exampleset matsize 200
set matsize 200, permanently
The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.