I am new to survival curves and trying to graph them in R. I have the following columns in my excel file: Sample (Experimental or Control), Age (Old or Young), Sex (Male or Female), Bacteria status (either positive or negative) and days 0-20 (21 separate columns); see below for an example. My survival lasts 20 days and starts at day 0. Day 0 has the most and my samples die throughout and can end (n=0) before day 20, and sometimes there are a few remaining at the last day. I would then like x axis=day and y axis=survival probability and to compare experimental vs controls, sex, age and bacteria status using Log-Rank (Mantel-Cox) test.
Sample | Sex | Young | Bacteria Status | Day 0 | Day 1 | Day 2 |
---|---|---|---|---|---|---|
Experimental 1 | Male | Young | Positive | 35 | 34 | 33 |
Control 1 | Female | Old | Negative | 35 | 35 | 35 |