This page presents examples of user written graphics programs. You can obtain these programs by typing, search command_name, into the Stata command line and following the instructions. This page is…
Read More
Search Results for: stata
How can I graph two (or more) groups using different symbols? | Stata FAQ
Suppose we are using the high school and beyond data file (hsb2) which has test scores for 200 students, 91 males and 109 females. We could make a graph…
Read More
How do I save a Stata graph as an EPS file? | Stata FAQ
The graph export command can be used in Stata to save a graph as an Encapsulated Postscript file for use in applications like LaTeX. Here is a simple example. use…
Read More
How do I use version 7 graph commands in later versions of Stata? | Stata FAQ
Say that we use the hsb2 data file for the examples shown here. use https://stats.idre.ucla.edu/stat/stata/notes/hsb2, clear and say that you wanted to see the scatterplot and regression line between write…
Read More
How can I graph data with dates? | Stata FAQ
This FAQ shows examples of graphing data where the x axis represents dates. For these examples, we will use the sp500 data file that comes with Stata and we can use…
Read More
Linear growth models: mixed vs sem | Stata FAQ
Growth models are a very popular type of analysis. Many growth models can be run either with mixed or sem and yield the same results. This page will provide several…
Read More
How can I sample from a dataset with frequency weights? | Stata FAQ
If you are working with a dataset that contains frequency weights, you may wish to sample from your dataset according to these weights. Example 1: Using expand and sample In…
Read More
How can I translate a file into a Postscript file? | Stata FAQ
Sometimes you might want to convert a file into a postscript file. For example, you might want to convert the Stata help file on regress command into a postscript file…
Read More
How can I fit a random intercept or mixed effects model with heteroskedastic errors in Stata? | Stata FAQ
It is common to fit a model where a variable (or variables) has an effect on the expected mean. You may also want to fit a model where a variable…
Read More
How can I combine a histogram and a boxplot in Stata? | Stata FAQ
UCLA ATS has written a command called histbox that will produce this type of graph. To get this program just type the following into the Stata command box and follow…
Read More