Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trend graphs for repeated cross-sectional data

    Hi,
    I'm a student and I'm working with a repeated cross-sectional dataset. I would like to create some simple graphs with the variable "WAVE", which identifies the year of the survey, on the x-axis as a time variable. On the y-axis, I would use some categorical variable such as "SODLAV" which is a variable with 4 categories describing the satisfaction of the respondent about his job. The idea is to plot the change over time using some simple indicator of well-being.
    The time variable, WAVE, goes from 1993 to 2018. I created this variable as a categorical var.

    Since all the observations are different I can't use the dataset as a panel. Also, it's not a time series because I have repeated time values.
    I tried using the "line" command [line WAVE SODLAV], but I get an unreadable plot, something like that:
    Click image for larger version

Name:	unreadable graph.JPG
Views:	1
Size:	48.5 KB
ID:	1582433

    I think the issue is that STATA is reading "WAVE" as a simple categorical variable, that's why there are the frequencies of WAVE on the graphs (?). I would like to have a line for each category of the y-variable (in this case, SODLAV, so 4 lines) and see how it changes through the years.
    Are there some commands or options that I can use? I don't know if it's a simple issue or if there is something I have to change on my data.


  • #2
    Code:
    line WAVE SODLAV 
    isn't credible as the code you used as SODLAV would go on the x axis. Also even with

    Code:
    line SODLAV WAVE 
    you can get in a mess if lines for different people get connected spuriously. It's also doomed to puzzlement as you can have no idea which trajectories are common and which rare.

    The graph (at best) shows all the individual trajectories. It won't aggregate for you. For that purpose, the community-contributed command

    Code:
    tabplot SODLAV WAVE
    would be a better start. At the same time it can't tell you much directly about transitions.

    Code:
    search tabplot
    in an up-to-date Stata will give you a download link and a thread such as https://www.statalist.org/forums/for...updated-on-ssc will give some flavour.

    Comment

    Working...
    X