Potential Problems

Potential Problems


This page is still under construction. Need help? Come to the ERL or email us!


Type mismatch

Sometimes the variables you want to use for analysis are of different types and Stata won't allow them to be used together. For example, you might have a string varaible but need it to be a numeric variable. In this case, the "encode" command will usually solve your problem. Simply type "encode variable, gen(variable2)," where "variable" is the name of the string variable you want to convert and "variable2" is the name you're giving the newly converted numeric variable. Be sure to tab out the new variable. If your variable has 5-categories, for instance, encoded variables automatically label the first category 1, the second 2, etc. This can be confusing if the variable originally had a different underlying coding, but it's pretty straight-forward if you're careful about it. 

Not enough space to load a dataset

New versions of Stata automatically allot a sufficient amount of space, but sometimes older versions have trouble loading large datasets. In this case, you can tell Stata to use more memory by typing "set mem 500m" ("500m" is an example; you can pick any value sufficiently large -- but not too large that it slows down your computer!). However, if you try to do this in Stata 12, you will get this message: "Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically."




<< Back to Data Visualization      
Continue to Creating a Dataset in Stata >>


Return to Table of Contents