I think I must be missing something obvious, but I'm having trouble 
getting a data transformation to work on groupings of data within a data 
frame (csss3) as defined by 2 factors (population, locid).  The data are 
sorted by year within locid within population and I want to lag another 
variable (dbc), i.e, shift them down by 1 row replacing the first row with 
NA, within groups defined by locid nested within population.  I thought I 
could do something using by(csss3,list(locid, population), function) but 
don't seem to be having any success.  Any suggestions??

Brian

Brian S. Cade

U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO  80526-8818

email:  brian_cade@usgs.gov
tel:  970 226-9326
	[[alternative HTML version deleted]]


