Any grouping will be lost. You must have the relevant package installed to convert to the type for that package. Conversions from pdata.frame
will be improved if sjlabelled
is also installed.
When using panel_convert
, be aware of the requirements that each type has:
Feature/Requirement |
pibble |
tsibble |
pdata.frame |
panel_data |
|
|
|
|
|
ID |
.i |
key |
index[1] |
id |
Time |
.t |
index |
index[2] |
wave |
Gap control |
.d |
regular |
No |
No |
ID must exist |
No |
No |
Yes |
Yes |
Time must exist |
No |
Yes |
Yes |
Yes[1] |
Only one ID variable[2] |
No |
No |
Yes |
Yes |
[1] pdata.frame
does not require that time be provided, but if not provided will create it based on original ordering of the data. The pdata.frame
option to set index
equal to an integer for a balanced panel and have it figure out the rest by itself is not supported.
[2] Use pmdplyr::id_variable()
to generate a single ID variable from multiple if one is required.
[3] pdata.frame
and panel_data
do not require that ID and time uniquely identify the observations on declaring the data, but functions in these packages may not work correctly without unique identification.
In addition to the above, be aware that the different packages have different requirements on which variable classes can be Time variables. pmdplyr::time_variable()
can build an integer variable that will work in all packages.
You may run into some trouble if your data contains variables by the names panel_convert_id
, panel_convert_time
, pibble_d
, or panel_convert_regular
.