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/