Hi,
Sorry if I'm being stupid here (I am a bit of a Stata novice!), but looking for a way to graph number of observations based on a date variable, and filtering using other variables. In particular I want to see the cumulative number of observations over a period of days (of the order of 50 days, with each observation only recorded as a date), with a single point plotted on a graph for each of those days. I also need to be able to filter this data based on other variables at will.
The former I haven't had a problem with as I can create temporary cumulative variables and graph these, but this is a bit of a workaround, and I don't particularly fancy coding this separately for each of the combinations of filters I might wish to apply.
For example (and not what I am working on):
Lets say my observations are purchases of tins of paint. Each has a date associated with the purchase, and is a tin of a specified colour and a specified size. I want to be able to graph the cumulative number of purchases of paint tins over time (with date as my x axis, cumulative number of tins as my y axis), but I also want to be able to easily filter this to look at the same graph for individual colours or size of tins. In my own work the number of combinations of 'colours' or 'sizes' of tins is well into four digits, so coding each separately is far from ideal. In an ideal world these is a single line of code that I can just add 'if colour == XXX & size == YYY' to at will.
Am I just being stupid?
Thanks!
I
Sorry if I'm being stupid here (I am a bit of a Stata novice!), but looking for a way to graph number of observations based on a date variable, and filtering using other variables. In particular I want to see the cumulative number of observations over a period of days (of the order of 50 days, with each observation only recorded as a date), with a single point plotted on a graph for each of those days. I also need to be able to filter this data based on other variables at will.
The former I haven't had a problem with as I can create temporary cumulative variables and graph these, but this is a bit of a workaround, and I don't particularly fancy coding this separately for each of the combinations of filters I might wish to apply.
For example (and not what I am working on):
Lets say my observations are purchases of tins of paint. Each has a date associated with the purchase, and is a tin of a specified colour and a specified size. I want to be able to graph the cumulative number of purchases of paint tins over time (with date as my x axis, cumulative number of tins as my y axis), but I also want to be able to easily filter this to look at the same graph for individual colours or size of tins. In my own work the number of combinations of 'colours' or 'sizes' of tins is well into four digits, so coding each separately is far from ideal. In an ideal world these is a single line of code that I can just add 'if colour == XXX & size == YYY' to at will.
Am I just being stupid?
Thanks!
I
Comment