FAQ Database Discussion Community


How to Remove Patients with Less Than 2 Visits of Data [duplicate]

r,subset,panel-data
This question already has an answer here: subset() a factor by its number of observation 1 answer I have a longitudinal dataset structured as 1 row per visit. A numerical patient ID number indicates unique patients. How can I remove all patients with less than 2 observations from my...

How to export Stata xtcsd test results?

stata,panel-data
I would like to export results of cross section dependence tests for 12 panel data sets to a table in order to compare them with similar tests done with different software. Below is the regression and test instruction example from the xtcsd help page (unfortunately the example dataset is not...

How to subset all rows from data frame for repeated measures

r,panel-data
The background for my question is: I have a dataset consisting of repeated measures, one data point per row. These data are from a longitudinal study and therefore at the moment not every subject has all data points. I would like to be able to extract all data points the...

Creating panel-data with a lot of data in R

r,panel-data
I currently have a problem combining a lot of data into panel-data. I have found this solution which helps me for "smaller" solutions: Panel Data but I cannot apply this to a "bigger" format. I will try to make a coding example: From the package ‘datasets’: df_1 = WorldPhones #...