[R] for loop in R

2017-01-12 Thread Jennifer Sheng
Dear friends, I am working on a double loop using for. One level of loop is to predict N times for each subject, and the second level is to predict M times for the every subject, one subject after one subject. Please note every subject have different N or M rows of data. Any advice? Thank yo

[R] Conditionally remove rows with logic

2016-08-07 Thread Jennifer Sheng
Dear all, I need to remove any rows AFTER the label becomes 1. For example, for ID 1, the two rows with TIME of 15 & 18 should be removed; for ID 2, any rows after time 6, i.e., rows of time 9-18, should be removed. Any suggestions? Thank you very much! The current dataset looks like the follo

[R] JM plotting

2016-05-26 Thread Jennifer Sheng
Dear Users, When the joint modeling was run in ER, the run was completed successfully with co-eff output. However, in the terms plotting, somehow the plot (fitjoint.null) does not work, with following error message. Any advice from the group? Thank you very much! Best regards, Jenny Error in