Just synced new code that solved that problem we experienced Tuesday. The fix we tried in class was correct, but I didn't realize we were replacing a data.frame name (ptProcessChemo) with itself after the looping code (cautionary tale: not best practice to continually write over an old dataset if you ever submit code line by line like I do). Thus, I was applying the correct code to an already corrupted data.frame. I should have created the data.frame anew and then applied the code. Anyway, it works now, although we still can't replicate K&K's table b/c our sample size is different from theirs.
Finally, I rewrite the Time1-Time3 variable code to make it more efficient. Probably worth browsing when you get a second (I commented out the old method).
Just synced new code that solved that problem we experienced Tuesday. The fix we tried in class was correct, but I didn't realize we were replacing a data.frame name (ptProcessChemo) with itself after the looping code (cautionary tale: not best practice to continually write over an old dataset if you ever submit code line by line like I do). Thus, I was applying the correct code to an already corrupted data.frame. I should have created the data.frame anew and then applied the code. Anyway, it works now, although we still can't replicate K&K's table b/c our sample size is different from theirs.
Finally, I rewrite the Time1-Time3 variable code to make it more efficient. Probably worth browsing when you get a second (I commented out the old method).