Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Chi-Square-Test for Homogeneity

From   Maarten Buis <>
Subject   Re: st: Chi-Square-Test for Homogeneity
Date   Tue, 20 Nov 2012 13:35:09 +0100

On Tue, Nov 20, 2012 at 1:26 PM, "Rita Frühwald" wrote:
> I have 2 different samples. One from the previous year (2011) with about 500 observations. Another one from the current year (2012) with about 1500 observations. I included a binary variable in my data to represent whether the observation was collected in the previous or the current year. In both samples, I have a nominally scaled  varibale that  represents students' field of study (7 categories).
> I want to test whether the distribution of this variable (representing the students' field of study) is the same in both samples

Assuming you stored year in a variable named year and field of study
in a variable called field, type in Stata: -tab field year, chi2-. For
more see: -help tabulate twoway-.

-- Maarten

Maarten L. Buis
Reichpietschufer 50
10785 Berlin

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index