Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Scott Baldwin <baldwinlist@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Data preparation for Multilevel and Item Response Models |
Date | Wed, 20 Apr 2011 18:30:12 -0600 |
Try the following. *some item level data in wide format webuse bg2, clear *6 items *reshape to long format reshape long bg2cost, i(clinid) j(item) *the gen option of tabulate will create the dummy variables -- one for each item *add the quietly prefix to suppress the tabulate outpute tabulate item, gen(item) Depending on how your data are structured you may need to do make some adjustments. Best, Scott On Wed, Apr 20, 2011 at 3:12 PM, Christopher Sanford <sanf81@yahoo.com> wrote: > I am attempting to run a factor analysis for binary data and am requesting help > in preparing my data. Before running GLLAMM I know that I I need to do three > things: > > 1. Create dummy variables for each of the test items > 2. Stack the item responses > 3. Reshape the data into long form > > How do I create dummy variables for each item (not the responses)? I have > searched online and have only found examples of creating dummy variables for the > response categories. > > I should be able to stack the responses and reshape the data using the help > feature in Stata. > > Thank you for your help. > > Christopher Sanford > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/