Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Like %GL(r,n) in GLIM


From   Herb Smith <hsmith@pop.upenn.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Like %GL(r,n) in GLIM
Date   Tue, 27 Feb 2007 13:03:26 -0500 (EST)

Sorry for the "insider" nature of this post....  But if there are any of
you out there who remember running log-linear models under the GLIM
program, you will remember a nifty function for creating "factors" for
contingency tables.  The command

CALC newfac = %GL(r,n)

would create a variable (if I recall correctly) of 1,...,r in blocks of n

This meant that to input a high-dimensional (or any dimensional)
contingency table, one needed to only input the counts.  The structure of
the table (R x C, or R x C x G, etc.) could be accomplished quickly by the
%GL command.

So, in brief, I am looking for a command that creates a variable like:

1
2
3
4
1
2
3
4

and another like

1
1
1
1
2
2
2
2

and so on.

If no %GL like command exists, fine; I'm sure I can figure out a short way
to program this; but if such a command does exist, it would be good to
know.

Thanks,

--Herb

Professor of Sociology and
Director, Population Studies Center
230 McNeil Building
3718 Locust Walk CR
University of Pennsylvania
Philadelphia, PA  19104-6298

hsmith@pop.upenn.edu

215.898.7768 (office)
215.898.2124 (fax)
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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