Display machine information for reproducibility:

sessionInfo()

Q1. Git/GitHub

No handwritten homework reports are accepted for this course. We work with Git and GitHub. Efficient and abundant use of Git, e.g., frequent and well-documented commits, is an important criterion for grading your homework.

  1. Apply for the Student Developer Pack at GitHub using your UCLA email.

  2. Create a private repository biostat-203b-2021-winter and add Hua-Zhou, Chris-German and ElvisCuiHan as your collaborators with write permission.

  3. Top directories of the repository should be hw1, hw2, … Maintain two branches master and develop. The develop branch will be your main playground, the place where you develop solution (code) to homework problems and write up report. The master branch will be your presentation area. Submit your homework files (R markdown file Rmd, html file converted from R markdown, all code and data sets to reproduce results) in master branch.

  4. After each homework due date, teaching assistant and instructor will check out your master branch for grading. Tag each of your homework submissions with tag names hw1, hw2, … Tagging time will be used as your submission time. That means if you tag your hw1 submission after deadline, penalty points will be deducted for late submission.

  5. After this course, you can make this repository public and use it to demonstrate your skill sets on job market.

Q2. Linux Shell Commands

  1. This exercise (and later in this course) uses the MIMIC-IV data, a freely accessible critical care database developed by the MIT Lab for Computational Physiology. Follow the instructions at https://mimic-iv.mit.edu/docs/access/ to (1) complete the CITI Data or Specimens Only Research course and (2) obtain the PhysioNet credential for using the MIMIC-IV data. Display the verification links to your completion report and completion certificate here. (Hint: The CITI training takes a couple hours and the PhysioNet credentialing takes a couple days; do not leave it to the last minute.)

  2. The /usr/203b-data/mimic-iv/ folder on teaching server contains data sets from MIMIC-IV. Refer to https://mimic-iv.mit.edu/docs/datasets/ for details of data files.

    ls -l /usr/203b-data/mimic-iv
    ## total 12
    ## drwxr-xr-x. 2 huazhou huazhou   78 Jan 11 02:28 core
    ## drwxr-xr-x. 2 huazhou huazhou 4096 Jan 11 02:13 hosp
    ## drwxr-xr-x. 2 huazhou huazhou  189 Jan 11 02:25 icu
    ## -rw-r--r--. 1 huazhou huazhou 2518 Jan 11 02:13 LICENSE.txt
    ## -rw-r--r--. 1 huazhou huazhou 2459 Jan 11 02:13 SHA256SUMS.txt

    Please, do not put these data files into Git; they are big. Do not copy them into your directory. Do not decompress the gz data files. These create unnecessary big files on storage and are not big data friendly practices. Just read from the data folder /usr/203b-data/mimic-iv directly in following exercises.

    Use Bash commands to answer following questions.

  3. Display the contents in the folders core, hosp, icu. What are the functionalities of the bash commands zcat, zless, zmore, and zgrep?

  4. What’s the output of following bash script?

    for datafile in /usr/203b-data/mimic-iv/core/*.gz
      do
        ls -l $datafile
      done

    Display the number of lines in each data file using a similar loop.

  5. Display the first few lines of admissions.csv.gz. How many rows are in this data file? How many unique patients (identified by subject_id) are in this data file? What are the possible values taken by each of the variable admission_type, admission_location, insurance, language, marital_status, and ethnicity? Also report the count for each unique value of these variables. (Hint: combine Linux commands zcat, head/tail, awk, uniq, wc, and so on.)