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 at the end of May, and its replacement, statalist.org 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 <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
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
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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