Hello,
I think that what you are looking for is smtg like this:
graph bar (mean) price, over(id)
Hope this helps!
Etienne
Hi there,
I would like to create a graph with the value of a string variable in the x axis.
Right now I can do
line price id
and I get a graph of price against id (which is a numerical variable). However, I would like to have the value of a string variable on the x-axis so that I can have, for example, price against a variable {a b c d e f ...}
Any help please...
Hello,
I think that what you are looking for is smtg like this:
graph bar (mean) price, over(id)
Hope this helps!
Etienne
No I am trying to do a line graph with the ticks labeled by the vales in a string variable
Last edited by kungal; 09-04-2010 at 12:08 PM.
So you do want to plot price against id but you want to label the x-axis with a label associated to id? If this is what you want to do, then you should:
1/ define the label for id. If the label is in a string variable you can store the different values using "levelsof". Then you just have to use "label define" and "label val"
2/ use the options for xlabel. Smtg like this: "line price id, xlabel(..., valuelabel)
Or maybe I still don't understand what you want to do.
Yes, that is what I want to do. Thanks for your help but I still don't understand how this is going to work.
I have about 100 000 observations on the line graph and I need to have some words like "one", "two", ..., "ten" (for example) on the horizontal axis (there are far fewer words than id numbers).
I know I can use xlabel to label every 10 000th tick with a number but I need to have a word instead.
Then you can label only some values of your variable id. For instance:
label define example 1 "One" 100 "Two" etc. 100000 "Ten"
label val id example
and then line price id, xlabel(1 100 ... 100000, valuelabel)
Brilliant, works perfectly. You are a genius
Many thanks
|
|