HI all,
I have a dataset in long-format and would like to drop information so that I can just keep the lines in which I have data for each participant. The LopNr is the ID of the participant and the other important variables for me is the skadedate. For other viarbales (del_fom_date) each participant has 225 occurrences of an event, in long-format, since one of the participants has that number of sick leave spells during the follow-up. I just can't get the logic of how to drop the occurrences of individual who does not have any information in it without loosing the information for those who have it. Some participants do not have any sick leave, like case 4. but I do want to keep case 4 in for comparison of those who have sickleave and those who don't.
To make it clear, if a person has one sick leave spell, I want to keep 1 occurrent for that person but not all 225, some people might have 10 occurrences of sick leave and then I want to keep all of the 10 but not the rest of the 215, and for the person who has no sick leave I want to keep the first row but not the other 224 rows. Anyone with a smart solution?
Array Array
Related Posts with How to keep first record but drop missing in long
How to create a new variable containing the mean from other variablesI have panel data (extract shown below). For each subject, I would like to compute a single mean of …
Getting summary statistics for several vars in a single MSword tableMay be this is too much of an expectation, but I've been thinking of asking whether there is any com…
Problem implementing twoway parea in v15.1 in Windows - Patterns no longer appearThis is my first post, so please forgive/correct any protocol lapses. I would like to thank the aut…
trajectories of bp over time and annualized slopesHi all, First, I would like to apologize because my question is probably a general question of bios…
Program/loop help for replacing values of ordinal variablesHello everyone, I am attempting to write a program/loop for a series of 4 ordinal, variables. For …
Subscribe to:
Post Comments (Atom)
0 Response to How to keep first record but drop missing in long
Post a Comment