I’m teaching an online workshop for The Analysis Factor on survival analysis. It’s not announced yet, and I have a LOT of work to do before it is ready. One thing that will save me time is that I am taking many of my examples from the excellent textbook, Applied Survival Analysis Second Edition. One nice perk of this book is that the helpful folks at UCLA have taken every textbook example, and written up code (with comments!) to reproduce the book’s results. With the exception of a few advanced methods in later chapters, where only one or two software packages have the right capability, the code is written in parallel in R, SAS, SPSS, and Stata. They also have links to the raw data at the publishers website, and datasets stored in SAS format and SPSS format. How nice! Browse around and you’ll find software code for all the examples in other popular statistics textbooks as well.
Warning! The R examples look like they are from the first edition, not the second edition. A small nitpick for an otherwise very nice resource.
UCLA Institute for Digital Research and Education. Textbook Examples Applied Survival Analysis. Second edition by David W. Hosmer, Jr., Stanley Lemeshow, and Susanne May. Available at https://stats.idre.ucla.edu/other/examples/asa2/.