ADA1: Class 01, Medical Records

Advanced Data Analysis 1, Stat 427/527, Fall 2025, Dr. Yan Lu, UNM

Author

Your Name

Published

August 20, 2025


Medical Records Assignment

In many data analysis projects you will be working with previously collected data; however, 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.

Note

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

1. (3 p) Select 3 variables recorded on the medical forms:

* one should be a unique identifier,
* one should be a quantitative variable, and
* one should be a categorical variable.

Solution: The 3 variables I selected are: patient ID (unique identifier), variable 1 (quantitative), and variable 2 (categorical).

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

Solution: Example — PAT_ID for patient ID etc

3. (3 p) Create a codebook listing variable names, labels, types, and response codes. (Use a table or list)

Solution:

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
------------------------------------------
(THESE ARE EXAMPLES. DELETE THESE AFTER YOU'VE MADE YOUR OWN!)
---
ID
  Unique Identifier
  categorical
  00001 - 99999
Var_1_nice_name
  variable 1 short description
  categorical
  0 = "type 1"
  1 = "type 2"
Var_2_good_name
  variable 2 short description
  continuous
  [0, 120]

4. (2 p) Enter data (make up values) for 5 patients in the data table below.

Solution (modify this table): First, you may want to complete the codebook above, then return to fill in your made-up fake data.

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

ID Var_1_nice_name Var_2_good_name
00001 a x
00002 b y
00003 c z

5. (1 p) Render this qmd file to an html, print to pdf, and upload to UNM Canvas.