Hi all, hoping to get some assistance in constructing a Sankey Plot to visualise a simple 2x2 matrix of transition probabilities using Stata 17.0. I have read the help documentation attached to the sankey_plot package (author: Fernando Rios-Avila) but am having difficulties adjusting the code examples to my panel data set.
My data: I have a panel data set of just under 400,000 observations (about 20,000 distinct id units over 20 years). My variable of interest is a binary variable called "neet" (indicates whether an id was NEET in a given year or not) and in this example, I am restricting attention to a subgroup classified as "young20" and only considering transitions from 2019-2020 (last two years in my sample). I have constructed a 2 x 2 transition matrix to compute the probability of transitioning between "NEET" and "non-NEET" between 2019 and 2020 for this group using the code:
Goal: I would now like to visualise the transition probabilities defined for me in the above transition matrix using a Sankey Plot (open to any other suggestions on how to visualise transition probabilities, but from some reading online understand that a Sankey Plot is typically used). Unfortunately I am unable to post my data here and am not sure if this is typically required for Statalist posts (first time posting in a couple of years)! Any guidance would be much appreciated.
My data: I have a panel data set of just under 400,000 observations (about 20,000 distinct id units over 20 years). My variable of interest is a binary variable called "neet" (indicates whether an id was NEET in a given year or not) and in this example, I am restricting attention to a subgroup classified as "young20" and only considering transitions from 2019-2020 (last two years in my sample). I have constructed a 2 x 2 transition matrix to compute the probability of transitioning between "NEET" and "non-NEET" between 2019 and 2020 for this group using the code:
Code:
xttrans neet if young20==1 & year>2018
Comment