Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: help on data format


From   "Eric G. Wruck" <ewruck@econalytics.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: help on data format
Date   Wed, 27 Apr 2005 10:14:19 -0400

I think you'll have to provide a few more details before you'll get much help.  How did you read these data in to begin with?  You'll likely want to convert the dates to Stata dates; also, the $ symbols and imbedded commas in the value fields will also entail a certain amount of work.  Show us what you have after you've read in the data & then perhaps someone will be able to offer constructive assistance on your attempted reshape.  What was your reshape statement?

Eric
 

>Hello List,
>
>    I have several text files which contains data elements like the
>following:
>Var 1	Customer #	3427
>Var 2	State Name	GA
>Var 3	Order Qty	900,000
>Var 4	Start Date	9/20/2004
>Var 5	Incentive Structure
>	First Level		31.56
>	Second Level	58.22
>	Third Level 	7.8
>	Forth Level	0
>	Fifth Level	2.43
>Var 6	Weekly    	Sales
>Week1	9/27/2004	$425,755
>Week2	10/4/2004	$229,226
>Week3	10/11/2004	$160,841
>Week4	10/18/2004	$145,643
>Week5	10/25/2004	$101,873
>Week6	11/1/2004	$97,313
>Week7	11/8/2004	$66,184
>Week8	11/15/2004	$43,848
>Week9	11/22/2004	$38,841
>
>Each text file contains data for a single customer. I would like to
>combine these text file to create a data set for all the customers and
>make the second column as variable names and have third columns as the
>values for the variables. So, it will look like the following:
>Customer# StateName OrderQty
>StartDate...ForthLevelIncentive.....Week9/27/04
>     3427        GA  900,000   9/20/04                     0
>425,755
>
>I attempted with reshape but didn't work out. Can anyone please provide
>me any help?
>
>Thank you.
>
>Sincerely,
>Pinaki Mitra



-- 

===================================================

       Eric G. Wruck
       Econalytics
       2535 Sherwood Road
       Columbus, OH  43209

       ph:      614.231.5034
       cell:    614.327.4182
       fax:     614.231.5039
       eFax:    614.573.6639
       eMail:   ewruck@econalytics.com
       website: http://www.econalytics.com

====================================================
*
*   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