In Stata, how do I conduct a Chi-square test with aggregate data?
In Stata, both the
.tabi commands conduct the Pearson's Chi-square test. The
.tabulate (may be abbreviated as
command produces one- or two-way frequency tables given one or two
variables. The commands also can run a Chi-square test using the
The above command will produce a cross-table of
gender and its Chi-square statistic.
When you do not have individual data, but only aggregate
frequencies, use the
.tabi command. You must list the
frequencies of each cell with a backward slash
\ ) to separate a row of a table. Consider
the following examples:
The first command conducts a Chi-square test for a 2x2 table, while the second and third commands run the test for 3x2 and 2x3 tables, respectively.
If you have questions about using statistical and mathematical software at Indiana University, email UITS Research Analytics (formerly known as the Stat/Math Center). Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200, and is open for consultation by appointment Monday-Friday 9am-5pm. For more, visit Research Analytics on the web, or call 812-855-4724 (IUB) or 317-278-4740 (IUPUI).
Last modified on August 02, 2013.