I am translating some Stata syntax to R in RStudio and have no clue about how I can list the response patterns in my paneldataframe after I defined the panelstructure with the package plm.
Do someone know how to see the response patterns of the data? In Stata the command is simply xtdes (after also defining the panelstructure with xtset)
I am thankful for any help! ✌️
PS: In Stata the Output looks like this:
Edit:
An example of my data is:
structure(list(persnr = c(21L, 21L, 21L, 41L, 41L, 41L, 51L,
111L, 111L, 121L), wave = structure(c(2004, 2005, 2006, 2004,
2005, 2006, 2006, 2004, 2005, 2004), label = "wave", class = c("labelled",
"numeric")), sex = structure(c(2L, 2L, 2L, 1L, 1L, 1L, 2L, 1L,
1L, 2L), .Label = c("man", "woman"), class = "factor"), edincome = c(1245,
1275, 814, 480, 502, 524, 1246, 2734, 2434, 1195)), .Names = c("persnr",
"wave", "sex", "edincome"), row.names = c(NA, 10L), class = "data.frame")
And as can be seen, participant with personnr. 111 is for example in wave 2004 and 2005 but not in 2006 and person 51 only in 2006.
I would like to know how I can display a table in which I can simply see how many participants participated to each wave, to the first two waves or just to the third wave and so on.
to set the data as a paneldata frame the script is_
library(plm)
pdata <- plm.data(data, index = c("persnr", "wave"))