Version info: Code for this page was tested in Stata 12.1. This code fragment page shows an example using Mata to write a function that calculates the SRMR by comparing…
Read More
Search Results for: stata
Anova | Stata Code Fragments
Please Note: This page has been updated to Stata 12 as of May, 2012. use https://stats.idre.ucla.edu/stat/data/crf24, clear * descriptive statistics by group or cell: table a b, contents(freq mean y…
Read More
Descriptives, ttests, Anova and Regression | Stata Code Fragments
* descriptive statistics: summarize x1 summarize x1, detail /* 5 number summary */ stem x1 /* stem & leaf diagram */ graph x1, normal /* histogram */ lv x1 /*…
Read More
Comparing Regression Coefficients Across Groups using Suest | Stata Code Fragments
The FAQ at https://stats.idre.ucla.edu/stat/stata/faq/compreg3.htm shows how you can compare regression coefficients across three groups using xi and by forming interactions. This can also be done using suest as shown below….
Read More
Fitting a seemingly unrelated regression (sureg) manually | Stata Code Fragments
The Stata command sureg runs a seemingly unrelated regression (SUR). That is a regression in which two (or more) unrelated outcome variables are predicted by sets of predictor variables. These…
Read More
Creating and extending boxplots using twoway graphs | Stata Code Fragments
Standard boxplots, as well as a variety of “boxplot like” graphs can be created using combinations of Stata’s twoway graph commands. If you are trying to create a relatively standard…
Read More
Writing to a text file | Stata Code Fragments
This code fragment describes how to write results from Stata to an external text file. The text file is tab separated and can be read by either a text editor…
Read More
Accuracy in Parameter Estimation | Stata Data Analysis Examples
Introduction Not all sample size issues are directly related to power. Accuracy in parameter estimation (AIPE) is also a function of sample size, that is, the larger the sample size…
Read More
Canonical Correlation Analysis | Stata Data Analysis Examples
Version info: Code for this page was tested in Stata 12. Canonical correlation analysis is used to identify and measure the associations among two sets of variables. Canonical correlation is…
Read More
_Change_me_to_your_model | Stata Data Analysis Examples
Examples of _your_model Example 1. Example 2. Example 3. Description of the Data _Describe_your_data_in_this_section, in Stata, all the data sets should be read in from the internet by using Let’s…
Read More
