← All Data Visualization with AI modules

Module 1 — Questions, Data & Cleaning

QuantegyAI Module 1 · Due the date on Canvas

From statistical question framing to data dictionaries, cleaning logs, and missingness audits.

What we will study in this module

Every data visualization begins with a question, and every defensible chart depends on data that has been inspected before it is drawn. Module 1 covers those two foundations. First we learn to frame a statistical question precisely: name the population, the observational unit, and the variables, decide whether the question is descriptive, comparative, relational, or causal, and match the claim we intend to make to the study design that produced the data. Then we turn to the data itself: build a data dictionary, diagnose why values are missing and whom the missingness affects, separate unit and entry errors from genuine outliers, and record every cleaning decision with its limitation so a reviewer can retrace it.

We practice these decisions in short interactive labs, verify them in the browser R lab, and then record two Project 1 evidence items: DV01, a statistical question and data contract, and DV02, a cleaning and missingness audit. The module mastery check confirms both skills. By the end we should be able to defend not only what a dataset shows but whether it was ever able to answer the question we asked of it. Every lab defines its terms before it asks a question, and a True/False alternative is available for any question that cannot otherwise be completed.

By the end of this module, you will be able to

Focus questions

Keep these questions in mind as you work through the module. Answer them in your guided notes, and use them to decide what belongs on your reference card.

  1. How does the observational unit of a dataset differ from the population a question concerns, and why must the data dictionary state what one row represents before any count or average is reported?
  2. Using the defect labels from the dirty-data audit, how would you classify and repair a row whose category is spelled differently from its neighbors and a row that repeats another record exactly?
  3. When an assistant proposes a step-by-step cleaning protocol, what evidence from the data and the data dictionary would justify accepting, modifying, or rejecting each step, and why is a plausible proposal not yet a verified one?
Start here

Your goal

Turn messy data into a defensible statistical question and cleaning plan.

TimeAbout 75–90 minutes
We will saveDV01 + DV02 evidence
Start Module 1 →
What you will learn

Statistics focus: variables, observational units, sampling frames, missingness, outliers, and defensible inference boundaries.

Tool focus: Inline browser R labs with base R and ggplot2; no installation is required. An optional desktop RStudio/Positron setup with tidyverse is available for the Project 1 assignment, but nothing here requires it.

  1. Turn a vague topic into an answerable statistical question naming the population, observational unit, variables, time frame, and inference boundary.
  2. Classify each variable’s type and measurement level and state which summaries and visual encodings it makes legal.
  3. Distinguish unit errors, implausible values, duplicates, and genuine outliers — and justify a different repair for each.
  4. Diagnose a missingness pattern and explain when complete-case deletion is safe and when it biases the estimate.
  5. Verify an AI-proposed cleaning protocol step by step, recording Accept/Modify/Reject verdicts with evidence.
  6. Assemble a data dictionary and cleaning log another analyst could audit and reproduce.
About your submission

Project 1 evidence: complete DV01 and DV02, then request formative AI feedback before the Project 1 submission.

Your packet includes: a data dictionary, cleaning log, missingness explanation, and an AI accepted/rejected table.

What is submitted where: For Canvas, upload at least one artifact from your work or a screenshot of your grade. A full ZIP is optional. The Project 1 page brings together the required evidence from its modules. Requesting AI feedback on this page saves formative coaching inside QuantegyAI and does not submit to Canvas.

Scope of the written work: use the provided data and R output, choose the defensible category or repair, and explain the decision in a few clear sentences. No question requires long arithmetic or exact decimal matching.

Statistical question formation

Academic anchor: before any chart or cleaning decision, a vague topic must become a researchable statistical question that names the population, observational unit, variables, time frame, and inference boundary.

Before the builder · what a question needs, and what a design can claim
  1. Observational unit. The unit is what one row of the data represents; in a well-organized table each row is one observation, and each kind of observational unit has its own table (Wickham, 2014). If the question is about students but one student can appear in several rows, for example one row per tutoring session, then counting rows as if each were a separate student inflates the evidence. State the unit before any count, average or rate.
  2. Inference boundary. The boundary says who the data represent and which claims the design can support. A convenience sample, such as the students who happened to join one online group, describes itself; it cannot stand in for a wider population.
  3. Association versus cause. Causal claims require a suitable study design and justified identification assumptions. Randomized comparisons can support causal inference under assumptions such as consistent treatment definitions and appropriate handling of attrition. Matching alone is insufficient: observational comparisons also need assumptions including no unmeasured confounding and overlap between treatment groups. Other designs can identify causal effects under their own assumptions. Two variables that move together in observational data support an association. A before-and-after change in the same students, with no comparison group, supports a description of the change, not a claim about what caused it. A causal effect compares the outcomes of the same units under different treatments, only one of which is ever observed, so inference requires a justified way to estimate the unobserved counterfactual outcome (Holland, 1986; Rubin, 1974).

The statistical question formation builder needs JavaScript.

When this activity is complete: Continue → Interactive reading

Interactive reading

Five short claims about question framing, observational units, variable types, cleaning, and inference boundaries. Select True or False before opening each explanation, then read the explanation either way. Reading ahead is allowed; each check remains open until it is answered. Module 1 turns loosely stated ideas into defensible statistical questions before AI tools or visualization enter the workflow.

Two further terms used in these checks. The observational unit and the inference boundary are defined in the preceding step.

Categorical variable
A variable whose values are labels, such as a campus name or a practice path. Labels are counted, and compared as proportions; they are never averaged, because a label has no numeric value to average (Stevens, 1946).
Complete-case deletion
Dropping every row that has a missing value. For a mean, it introduces no bias when values are missing for reasons unrelated to the data, although it always reduces the sample. When missingness is related to the outcome, for example when lower-scoring students skip the post-test more often, deleting incomplete rows can bias the results (Rubin, 1976; Schafer & Graham, 2002).
Question formation · predict before reveal

A student asks: “Does screen time affect grades?” Naming the population it is about is enough to make this a defensible statistical question. True or false?

False. It also needs an observational unit, measurable variables, a data source, a time frame, and an inference boundary. And the word “affect” is causal language; unless the study design supports causality, reframe the question as an association question.
Observational unit · predict before reveal

A spreadsheet has one row per tutoring session, but the research question asks about students. If one student can appear in several session rows, summarizing the rows as if each were one student inflates the evidence. True or false?

True. The observational unit controls what one row represents. If one student can appear in multiple session rows, treating sessions as students inflates the evidence and can distort averages, rates, and uncertainty. The data dictionary must state the row unit before any chart is defended.
Variable type · predict before reveal

A column records practice path as “Algebra,” “Geometry,” or “Statistics.” An AI assistant may report the mean of this variable. True or false?

False. Practice path is categorical, so counts, proportions, and bar charts are appropriate. A mean requires a quantitative variable. Classifying variables first prevents AI from applying illegal summaries or recommending charts that do not match the measurement type.
Cleaning decision · predict before reveal

An AI assistant says: “Delete every row with a missing value before visualizing.” That is a safe default. True or false?

False. Missingness is evidence. Complete-case deletion may be reasonable in some settings, but it can bias results when missingness is related to the outcome, difficulty, time, device, or participation pattern. A defensible cleaning log explains what was missing, why it may be missing, and what rule was applied.
Inference boundary · predict before reveal

A small convenience sample from one online practice group shows a higher completion rate after a reminder. The strongest defensible claim describes this sample and flags an association worth studying, but stops short of a population-wide or causal claim. True or false?

True. The evidence can describe this sample and may suggest an association worth studying. It does not automatically justify a population-wide or causal claim. The inference boundary should name who the data represent and which claims the design cannot support.
When the reading checks are complete: Continue → Question triage lab

Question triage lab

Why this lab Sort questions by what they ask of the data.

Visualization begins with a statistical question, not a chart type. Classify each statement by what it asks of the data, and note how often a causal verb appears in a question whose design cannot support it.

The five categories. Every statement in the lab belongs to exactly one of them.

Topic (not yet a question)
A subject area with no population, unit, or measured variable. No dataset can answer it yet.
Descriptive question
Summarizes one variable in one population: a median, a proportion, a typical value.
Comparative question
Sets two or more defined groups side by side on one outcome and asks whether they differ.
Relational question
Asks how two variables measured on the same units move together — “is associated with”.
Causal claim
Asserts that one thing produces a change in another (“raises”, “improves”). Only a design built for it can support it.

If a statement cannot be classified, a True/False alternative appears beneath it.

The question triage lab needs JavaScript.

When this activity is complete: Continue → Types of data lab

Types of data interactive lab

Why this lab Match each variable to its data type so the right checks apply.

Before choosing a visualization, classify the variable correctly. The data type, and in particular its scale of measurement (Stevens, 1946), determines which summaries are meaningful, which chart encodings represent the values faithfully, and which claims an AI-generated summary may make. Then build the data dictionary yourself: it is the contract that every later chart in the project must satisfy.

The data-types lab needs JavaScript.

When this activity is complete: Continue → Dirty-data audit

Dirty-data audit

Why this lab Identify every defect that would invalidate an analysis.

A real extract arrives with inconsistent labels, missing values, duplicates, implausible entries, and unit errors mixed together. Diagnose each row before repairing it: an incorrect diagnosis leads to an incorrect repair, and a deleted row cannot be recovered from the analysis file.

The six defect labels. Read the row against the rest of its column, then name what is wrong with it.

Inconsistent coding or format
The same thing written two ways — “retaker” beside “Retaker”, or a date in a different format. Software treats them as different values, which is why categories are coded consistently and dates are written in one form, such as YYYY-MM-DD (Broman & Woo, 2018).
Missing value
A cell that was never recorded (shown as NA). Whether it can be dropped depends on why it is missing.
Duplicate record
The same row entered twice. It inflates the sample size without adding information.
Implausible value
A number that cannot be right for this variable and has no unit that explains it — most likely a typing slip.
Unit mismatch
A number recorded in the wrong unit, such as minutes in an hours column. The value is real; the unit is wrong. A plausible conversion is a hypothesis, not proof: confirm the unit against the source record, intake form or data dictionary before converting, and log the decision. If the unit cannot be confirmed, keep the row flagged and report results with and without it.
Clean record
The row contains no defect. Certifying clean rows matters: an audit that never certifies a row tends to remove valid data.

The dirty-data audit needs JavaScript.

When this activity is complete: Continue → AI-output audit

AI-output audit

Why this lab Rule on AI proposals before trusting them with your data.

An assistant proposes a six-step cleaning protocol. Rule on every step and build the “AI suggestions accepted / rejected” table that accompanies your data dictionary and cleaning log.

Two concepts used in the proposals. The other proposals use the defect types from the dirty-data audit.

Mean imputation
Replacing every missing value with the column mean. It invents values that all sit exactly at the center, so it understates the spread: the standard deviation shrinks and every interval built from it is narrower than the data justify. It also hides which values were never recorded (Schafer & Graham, 2002).
Rounding for display
Rounding the stored values discards measurement precision permanently. To make a chart easier to read, round only the axis and label formatting and keep the data at full precision.

The AI cleaning-log audit needs JavaScript.

When this activity is complete: Continue → Test the cleaning claim

Hands-on visual lab

Why this lab Test the rejected claim with a visual experiment.

In Lab 4 the assistant claimed that dropping every incomplete row always improves accuracy, and you rejected it. This lab tests that ruling directly: the data are held fixed, only the reason values go missing changes, and the complete-case estimate can be compared with the full-data value at each setting.

Three terms used in the readout.

Complete-case deletion
Keeping only the rows with no missing values and dropping the rest. It is what “delete every row with a missing value” means.
Missing completely at random (MCAR)
Values go missing for reasons unrelated to anything in the data (Rubin, 1976). Deletion then costs precision (a smaller sample) but does not bias the estimate.
Systematic missingness
Values go missing more often for some students than others — here, more often for low pre-test scores. Deletion then removes a particular kind of student, and the estimate shifts. The direction of the shift needs a link between the two scores: in this dataset students with higher pre-test scores also tend to score higher on the post-test, so the students who remain have higher post-test scores on average and the complete-case mean is pushed upward. Without that link, low pre-test missingness alone would not tell you which way the post-test mean moves. A bigger sample repeats the shift in expectation if the same selective mechanism and score relationship persist; increasing sample size alone does not remove that selection bias.

What to do: write your prediction, then drag the slider past 5 and compare the complete-case mean with the full-cohort mean.

The missingness explorer needs JavaScript.

When this activity is complete: Continue → Verify with R

Verify with R

Why this lab Reproduce the cleaning result with real R output.

You predicted what would happen. Now verify it computationally. Run scores, identify which variables contain missing values, and compare the output with your earlier reasoning.
R / Quarto / Shiny workflow

Inspect the provided scores dataset (student pre/post with missing values), count missingness by variable, and defend a cleaning decision.

Browser R note: this inline lab runs base R plus ggplot2 (installed automatically on first run). The full tidyverse collection is an optional desktop tool for RStudio or Positron. Every required task in this module runs in the browser.

The scores dataset and the full audit sequence — inspection, missingness counts, complete pairs, and the plot — are already loaded in this workspace. Press Run, then write three short sentences: what is missing, the rule you used, and one limitation. Log any AI assistance and corrections.

When the R lab has run: Continue → Build DV01 & DV02

Project 1 evidence: DV01 and DV02

You are not doing separate assignments here.

DV01 and DV02 are the evidence you will use in the Module 1 evidence form (step 10, Module 1 evidence and AI feedback). Complete and save both once; your work carries forward.

When DV01 and DV02 are saved: Continue → Get AI feedback

Module 1 evidence and AI feedback

Project 1 · Module 1 evidence review
This step draws on the work from the earlier stages.

Package the question, data decisions, R evidence, and AI-audit reasoning from those stages. This is one evidence-review step, not another assignment and not a Canvas submission.

How does grading work?

The AI score is formative feedback, not your grade. Use it to identify gaps, revise, and request updated feedback. Attempts are unlimited, and only your best work counts. A low AI score indicates that at least one rubric criterion needs more detail or evidence; it is not recorded as a grade.

Your official grade comes from Dr. Roberts's review of your Canvas packet. The AI grader provides formative feedback toward a complete, defensible packet before you submit Project 1 to Canvas. Read its feedback, revise the criteria it identifies, and request updated feedback as often as needed.

Where do I get my data?

Use scores. Everything you need is already provided in the Verify with R workspace. It is the small pre/post score dataset with built-in NA values, quantitative variables, a categorical identifier, and missingness to audit.

Step by step:

  1. Open the Verify with R workspace (step 8)
  2. Press Run — the scores dataset and the audit code are already loaded in that workspace.
  3. Run str(scores) and summary(scores) to inspect the structure.
  4. Run colSums(is.na(scores)) to get missingness counts per variable.
  5. Build your data dictionary and dirty-data audit from the output.
  6. Record your results in the Module 1 evidence fields below and select Get AI feedback →.
Advanced option: Use your own dataset

You may use a dataset included with R, such as airquality or mtcars, or the mpg dataset from ggplot2, or add a CSV under Your data in the R lab. The default scores path is already complete and remains the recommended route.

This assignment turns the Module 1 labs into a Project 1 evidence packet. You will refine one statistical question, classify the variables, audit the data quality, and document which AI cleaning suggestions were accepted or rejected.

Required evidence

The six required items are listed as the Module 1 evidence checklist below — tick each one as your evidence is ready, and the status line tells you when you can request AI feedback.

Mastery evidence: the final packet should show that the student can move from a vague topic to a defensible question, from raw variables to a usable data dictionary, and from AI-generated suggestions to verified cleaning decisions.

The inline Module 1 graded assignment and AI grader need JavaScript.

After you review the AI feedback: Continue → Mastery check

Prepare for the mastery check

Adaptive reflection · What I know / where I go next

Mastery check loading…

What Module 1 saved

Your saved Module 1 evidence needs JavaScript. You can also see it later on your report card in My Skills Dashboard.

After Module 1 Add this module’s evidence to the Project 1 packet. If your explanation depends on AI, include the prompt, output, verification method, and final correction.
When the mastery check is saved: Continue → Module 2