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 at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Replacing variable values after using collapse command


From   Matthew Krauchunas <krauchunasms@mymail.vcu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Replacing variable values after using collapse command
Date   Mon, 5 Jul 2010 16:55:34 -0400

Hello,

I need advice on how to replace variable values.  I have financial
data that contained more than 1 financial report in a single calendar
year.  With much advice, I have been able to identify and combine
those periods using the collapse command.  I then saved this file and
combined it with the master file via the append command.  My problem
now though is  how to combine the string information in the master
file with the values obtained after the collapse command.  Here is an
abridged example:

oshpd_fac_no	facility_name	snf_medcare_days	avg_occupancy_rate	combined_finance
206071028	OAK PARK CONVALESCENT HOSPITAL	351	63.71	0
206071028	OAK PARK CONVALESCENT HOSPITAL	1371	75.46	0
206071028		1722	72.506448	1


The oshpd_fac_no is the California assigned id number per PHYSICAL
address, the facility name is self-explanatory, snf_medcare_days &
avg_occupancy_rate were two of the variables collapsed respectively,
and combined_finance is an indicator variable created to show that
this observation was created via the collapse command.  Now the crux
of the problem....I need to combine the string information from the
first two variables with the collapsed values in the third
observation.  Thus, it should look like this when finished::

oshpd_fac_no	facility_name	snf_medcare_days	avg_occupancy_rate	combined_finance
206071028	OAK PARK CONVALESCENT HOSPITAL	1722	72.506448	1

Any ideas?

Thank you for all the help thus far!
Matt
*
*   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/


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