Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Getting string variable values on graph
From
Jibonayan Raychaudhuri <[email protected]>
To
[email protected]
Subject
st: Getting string variable values on graph
Date
Tue, 16 Mar 2010 23:41:55 -0700 (PDT)
Hi Statalist users,
I want to generate the time plots of expenditure on
44 products over a period of 104 weeks. My data (hypothetical)
look something like this:
Product Code ProductDescription Expenditure Week
1234 AppleJuice 100 1
1234 AppleJuice 110 2
1234 AppleJuice 120 3
1234 AppleJuice 100 4
1234 AppleJuice 130 5
1234 AppleJuice 140 6
1234 AppleJuice 100 7
1234 AppleJuice 100 8
. . . .
. . . .
. . . .
. . . .
. . . .
1234 AppleJuice 100 104
2234 OrangeJuice 100 1
2234 OrangeJuice 110 2
2234 OrangeJuice 120 3
2234 OrangeJuice 100 4
2234 OrangeJuice 130 5
2234 OrangeJuice 140 6
2234 OrangeJuice 100 7
2234 OrangeJuice 100 8
. . . .
. . . .
. . . .
. . . .
. . . .
2234 OrangeJuice 100 104
. . . .
. . . .
. . . .
. . . .
. . . .
Product code is numerical and Product Description is a string
variable.
I want to create a graph that would have the Product Description
"values" on the Y-axis. That is I want "Expenditure on "Product Description"" on the Y-axis where "Product Description" is "Apple Juice", "Orange Juice" and so on for all 44 products (the final output on
the Y-axis would state something like "Expenditure on Orange Juice",
for the second graph, for example).
I can get a loop to create all the time graphs for 44 products with
a numerical code like say "Expenditure on Product 2" on the Y-axis but
I cannot get "Expenditure on Orange Juice" on the Y-axis. Any ideas as
to how to go about getting the string values for the Product Description on the vertical axis of the graph in a loop?
Thankyou for your help.
Jibonayan
*
* 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/