This is the 2023 website for the course **Advanced Statistical
Topics in Health Research B** held by the University of Copenhagen. This website
provides practical information about the course.

- The course will start on
**Monday, May 8th**and end on**Thursday, May 11th**. - The course will run every day from
**8.15 to 15**. See the programme for more information. - Please install the necessary software
*before*the course start. See below. - We will follow chapters in Computer Age Statistical Inference: Algorithms, Evidence, and Data Science somewhat closely. A pdf-copy of the book can be downloaded from the author’s website. See notes for more information.
- Teachers for the course will be Benjamin Skov Kaas-Hansen, Benoit Liquet-Weiland, and Claus Thorn Ekstrøm.

Additional information will be given on the first day.

Many modern research projects collect data and use experimental designs that require advanced statistical methods beyond what is taught as part of the curriculum in introductory statistical courses. This course covers some of the more general statistical models and methods suitable for analyzing more complex data and designs encountered in health research such as methods for high-dimensional data, classification, imputation, and dimension reduction.

The course will contain equal parts theory and applications and consists of four full days of teaching and computer lab exercises. It is the intention that the participants will have a thorough understanding of the statistical methods presented and are able to apply them in practice after having followed the course. This course is aimed at health researchers with previous knowledge of statistics and the computer language R who need of an overview about appropriate analytical methods and discussions with statisticians to be able to solve their problem.

A student who has met the objectives of the course will be able to:

- Analyze data using the methods presented and be able to draw valid conclusions based on the results obtained.
- Understand the advantages/disadvantages of the methods presented and be able to discuss potential pitfalls from using these methods.

**Before** the course starts you should make sure that
you have installed the latest version of:

R and R Studio is also highly recommended but is not necessary.

Download and install Anaconda. During the installation, you don’t need to check any boxes or choose anything but the default installation options.

We will be working with a dataset about patients suffering from metastatic castrate-restistant prostate cancer. In order to access the data, you need to register at Project Data Sphere. Fill out a request for data access. This is quite important to do this early (as soon as possible) in order to get access to the data we will be using for the exercises.

Under “Research Description & Goals” you can write that you will be using machine learning methods (including deep learning) to predict survival and treatment discontinuation for prostate cancer patients in lines with the Prostate Cancer DREAM Challenge goals.

We will be using a few specialized R packages that you need to install

*prior*to arriving. Those are necessary for us to run the exercises. The code below should be run in R (e.g. by opening RStudio and copying them into the console) to install the packages that we will need. You need to be connected to the internet to install the packages. If you are a Windows user, you may need to run RStudio as an administrator in order to install the packages. This can be done by right-clicking the RStudio program icon and choosing “Run as administrator”.Note: At the moment, keras does not work on the new Mac M1 computers (2020 models). If you only have access to such a computer, please contact Anne (ahpe [at] sund.ku.dk) as soon as possible, so she can set up an alternative way for you to work with the package.

If you are working on any other computer, follow this installation guide:

To get keras working, you first need to install the R package:

`install.packages("keras")`

If the installation succeeds without any errors, you must continue to run the final two lines:

`library("keras") install_keras()`

This may take a while and you may be prompted for further installation choices along the way.

Finally, you can test your installation by running the following code:

`source("http://publicifsv.sund.ku.dk/~ahp/rcode/kerastest.R")`

If your installation was successful, the output should end with the following information (maybe with slightly different numbers):

`Results: Trained on 48,000 samples (batch_size=128, epochs=3) Final epoch (plot to see history): loss: 0.1509 accuracy: 0.9561 val_loss: 0.1148 val_accuracy: 0.9649`

If not, try running each step again and see if it helps.

Next step is installing

`stan`

for`R`

. Install the`rstan`

package for R as per these instructions.Once

`rstan`

is installed we need the`rethinking`

package. That package is not on CRAN so we will install it directly from github. You do that by running the following three lines:`install.packages(c("devtools","mvtnorm","loo","coda"), repos="https://cloud.r-project.org/",dependencies=TRUE) library("devtools") install_github("rmcelreath/rethinking")`

Finally you should install the following bunch of R packages:

`install.packages(c("isdals", "rstan", "brms", "rstanarm", "bayesplot", "MESS", "pROC"))`

Claus Ekstrøm 2023