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]

st: RE: Need help with -collapse- or a better solution

From   "Michelson, Ethan" <>
To   "" <>
Subject   st: RE: Need help with -collapse- or a better solution
Date   Sat, 1 May 2010 10:05:53 -0400

I'm no pro, but it seems to me the "reshape" command might be more relevant. If you have a variable that identifies 8 observations per unique id, then you can use reshape to create put all 8 observations on a single row. Then you can perform simple arithmetic to calculate the changes that interest you. But if you're interested in estimating models of change over time, then I think you'll need to bone up on event history analysis. In this case, the "snapspan" command might be relevant as a way to convert your data to something Stata can use to perform the appropriate analyses. Again, I'm a Stata novice and just signed up to this list today.... Good luck! Ethan

-----Original Message-----
From: [] On Behalf Of Reifschneider Harry III
Sent: Saturday, May 01, 2010 11:37 AM
Subject: st: Need help with -collapse- or a better solution


Stata/IC 10.1 for Macintosh
Born 01 Oct 2009

I need help with -collapse-. I am a grad student and thus just  
learning this software (and this is my first post), so please be gentle!

I have 8 years of data which are broken out into 1 year snapshots, so  
8 observations max for each person. I need to find a "change" in a  
test score (afqtscore for this example, but there are 5 total). Not  
all the observations have a change and thus I am only concerned with  
those that do change. The -help collapse- command talks about  
percentiles, means, etc., but I need the actual change, e.g. years 1-4  
score is 50 and in year 5 the score changed to 60 and then remains  
that way for the duration of the sample. I am looking at the  
probability of an increase/decrease in the score and the magnitude of  
change and need to know if there is a change and also the amount.  
Further more, I am only interested in the demographics (gender,  
age,marital status, etc.) at the time of the "updated" or newer score.  
Same thing goes for "civilianeduclevelcode1" . Can someone show me an  
example of the code to write to get at this requirement? If my  
description of the problem is lacking, I am sorry and can try better.  
Thanks and have a great weekend!

seqnumber is the "snapshot" of the fiscal year

uniqID		afqtscore	seqnumber	primarymos	maritalstatuscode	 
A17082		42			199			9900		S					12
A17082		42			211			341			M					12
A17082		48			223			341			M					12
A17082		48			235			341			M					12
A17082		79			247			341			M					14
*   For searches and help try:

*   For searches and help try:

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