code: public void saveSurvivalData(String fileName) throws Exception {
  		FileWriter fw = new FileWriter(fileName);
  		fw.write("index\tTIME\tSTATUS\tGROUP\r\n");
  		int index = 0;
  		for (String group : survivalData.keySet()) {
  			ArrayList<CensorStatus> sd = survivalData.get(group);
  			for (CensorStatus cs : sd) {
  				String line = index + "\t" + cs.time + "\t" + cs.censored + "\t" + cs.group + "\r\n";
  				index++;
  				fw.write(line);
  			}
  		}
  		fw.close();
  	}
docs: Save data from survival curve to text file
  
  @param fileName
  @throws Exception