Some Stata users have found that there are values of e(r2) and e(r2_a) after running the rreg. You can see it in the example below using the crime dataset. We…
Read More
Search Results for: stata
How can I draw a random sample of my data? | Stata FAQ
There are many instances when you may want to take a random sample of your dataset. For example, you may have a very large data set, and you are trying…
Read More
How do I do this SAS Command in Stata? | Stata FAQ
Say that you use SAS but wish to know how to do a particular command in Stata. For example, you want to make a new variable and know you can…
Read More
How can I save the contents of the results window? | Stata FAQ
Stata does not allow you to save the output in the Results window through the menu system. Stata does however offer ways to capture the output and save it to…
Read More
How can I do a scatterplot with regression line in Stata? | Stata FAQ
Stata makes it very easy to create a scatterplot and regression line using the graph twoway command. We will illustrate this using the hsb2 data file. use https://stats.idre.ucla.edu/stat/stata/notes/hsb2 Here we…
Read More
How can I make the Results window hold more results? | Stata FAQ
In Stata, the Results window holds up to 32000 bytes of information (output), after that, older output at the top of the buffer is replaced by new output when it…
Read More
How do I document and search a Stata dataset? | Stata FAQ
When going through data management steps in Stata, there are several documentation features available that allow you to attach information to the dataset. This approach to documenting allows you to…
Read More
What are the saturated and baseline models in sem? | Stata FAQ
Below is the diagram of a simple structural equation model. The dependent variable is a latent variable Acad with three observed indicators, math, science and socst. There are two additional…
Read More
How do sem and gsem differ? | Stata FAQ
Stata commands sem, introduced in Stata 12, and gsem, introduced in Stata 13 are very powerful and flexible. However, they differ on which options are allowed. The table below gives…
Read More
How can I do mediation analysis with the sem command? | Stata FAQ
The sem command introduced in Stata 12 makes the analysis of mediation models much easier as long as both the dependent variable and the mediator variable are continuous variables. We…
Read More
