ADA1: Class 02, Medical Records

Advanced Data Analysis 1, Stat 427/527, Fall 2022, Prof. Erik Erhardt, UNM


Your Name


August 13, 2022


PDS Ch 3: Medical Records Assignment (slightly modified)

Although in your project you will be working with previously collected data, it is important to understand what data look like as well as how they are coded and entered into a spreadsheet for analysis.

Scenario: Imagine collecting medical records for 5 patients seeking treatment in a hospital emergency room – you will be making up fake data for this assignment. Points for each component are indicated in parentheses.

  1. (2 p) Select 4 variables recorded on the medical forms (one should be a unique identifier, at least one should be a quantitative variable and at least one should be a categorical variable).

  2. (1 p) Select a brief name (ideally 8 characters or less) for each variable.

  3. (2 p) Determine the variable type and the range of admissible (possible) values for recording each variable (create indicator codes as needed).

  4. (2 p) List the variable names, labels, types, and response codes in the code book area (can be a table or a list, as demonstrated above).

  5. (2 p) Enter data (that you make up) for each patient in the data table area (to meet your needs, you may need to reformat the provided table).

  6. (1 p) Compile this Rmd file to an html, print to pdf, and upload to UNM Learn.

Help: Look at “Help > Markdown quick reference” for how to make a table, and other formatting.

This is a template for the assignment. Modify this and turn it in.



I’ve removed the more complicated “table” options discussed in the video, the verbatim block is universally the best choice for us.

You can make a “verbatim” code block with your variables and values:

Each variable block should have this form:
Your nice variable name
  Description of variable
  Variable type (categorical/numerical)
  Range of values, or categorical levels and labels

  Unique Identifier
  00001 - 99999
  variable 1 short description
  0 = "type 1"
  1 = "type 2"
  variable 2 short description
  [0, 120]


Modify the table below. First, you may want to complete the codebook above, then return to fill in your made-up fake data.

ID v2 v3
00001 a x
00002 b y
00003 c z