Simulating data is a powerful tool for understanding statistical models and for spotting identification problems. I will use simulation techniques to explain the building blocks for linear mixed models, and I will also show how to estimate the parameters using the xtmixed command. Using these basic blocks, I will explain how more-complex models can be constructed. Finally, I will explain some nice (but not obvious) applications of xtmixed.