16 Capstone Projects and Professional Publishing Workflows
A reproducible publication is more than a document that renders successfully. It is a coherent account of a question, the evidence used to answer it, the reasoning connecting evidence to conclusions, and the conditions under which another person can reproduce the work. In this chapter, six projects bring together the techniques introduced throughout the book. Each project has a different audience and publication objective, but all share the same expectation: the source, results, and final publication must agree.
16.1 Learning objectives
After completing this chapter, readers should be able to plan a publication, choose a computational engine, implement and validate an analysis, design an accessible learning experience, document dependencies, and release a versioned academic resource. Readers should also be able to distinguish a successful build from a scientifically valid analysis.
16.2 Planning a capstone
Begin with the intended reader rather than the software. A clinician needs a concise statement of the magnitude and uncertainty of a result; a student needs opportunities to reason before seeing a solution; an editor needs a manuscript that can be reviewed and revised. These audiences may require different outputs from the same underlying project.
Write a one-page project charter identifying the question, audience, data provenance, deliverables, publication destination, and acceptance criteria. Specify which components must be executable and which are intentionally illustrative. Decide whether the output will be public or private before selecting a hosting platform. A public website is not an appropriate location for confidential patient records, identifiable student information, or unpublished collaborator data without permission.
Use a consistent directory structure. Keep input data separate from generated outputs, and retain the scripts needed to regenerate figures. Use relative paths rather than paths tied to a personal computer. Record the version of Quarto and the computational packages. A clean build on another machine is stronger evidence of reproducibility than a successful build on the author’s laptop.
The six projects below have independent starter sources in examples/ch16/. Copy each project outside the parent book before rendering. The starter sources demonstrate the core technique; the assignment requirements deliberately extend beyond them.
16.3 Capstone 1: Reproducible biostatistics report using R
16.3.1 Background and research question
A hypothetical outpatient clinic evaluates two scheduling procedures. The outcome is waiting time in minutes. Eight simulated appointments are assigned to each procedure. The question is whether the mean waiting time differs between the new and standard procedures. The observations are entirely synthetic and are not evidence about a real clinic.
| Standard | New |
|---|---|
| 18 | 12 |
| 22 | 16 |
| 15 | 14 |
| 25 | 19 |
| 20 | 11 |
| 17 | 17 |
| 24 | 15 |
| 19 | 13 |
The rows of Table 16.1 are for compact presentation; they do not represent matched pairs. Define the contrast as new minus standard. The estimand is the difference in population means under the hypothetical independent-group design.
16.3.2 Statistical reasoning
For independent groups, Welch’s standard error is
\[ SE=\sqrt{\frac{s_N^2}{n_N}+\frac{s_S^2}{n_S}}. \]
The confidence interval uses a t critical value with Welch–Satterthwaite degrees of freedom. Unlike a pooled-variance test, this procedure does not require equal population variances. It still relies on independent observations and a sampling distribution that is adequately approximated by the t procedure. With eight observations per group, inspect individual values and consider whether extreme observations or dependence would undermine the interpretation.
16.3.3 R implementation
d <- read.csv("trial.csv")
a <- subset(d, group == "new")$wait
b <- subset(d, group == "standard")$wait
aggregate(wait ~ group, d, mean)
t.test(a, b, conf.level = 0.95)The estimated difference is \(14.625-20=-5.375\) minutes. The 95% interval is approximately (-8.71, -2.04) minutes, and the two-sided p-value is 0.0040. The negative sign indicates shorter waits for the new procedure. The p-value is not the probability that the null hypothesis is true. The interval is conditional on the design and model assumptions, and the synthetic nature of the data prevents a clinical recommendation.
16.3.4 Assignment and deliverables
Create an executable Quarto report with a research question, data dictionary, descriptive statistics, a dot plot, a Welch analysis, interpretation and limitations. Include a sensitivity analysis in which the largest new-group observation is omitted solely to illustrate influence, not to justify deleting inconvenient data. Compare the original and sensitivity results and explain why the full dataset remains primary. Record sessionInfo() and include the CSV file and a README with rendering instructions.
16.3.5 Acceptance criteria
The report must render from a clean directory; group sizes must be correct; the contrast direction must be consistent across text, tables and plots; and the conclusion must explicitly identify the data as synthetic. The figure should display all observations, have units and a meaningful caption, and be readable without color alone.
16.4 Capstone 2: Scientific manuscript using Python
16.4.1 Background
Use the same synthetic experiment to develop a manuscript in the Introduction, Methods, Results and Discussion (IMRaD) format. Reusing the data makes it possible to compare computational implementations rather than confounding language differences with dataset differences.
The introduction establishes a hypothetical operational problem and explains the outcome. The methods describe the data-generating scenario, the contrast, the analysis and the assumptions. The results report the estimate, interval and p-value without repeating every table entry. The discussion addresses limitations and avoids extrapolating simulated findings to actual patients.
16.4.2 Python implementation
import pandas as pd
from scipy import stats
d = pd.read_csv("trial.csv")
a = d.loc[d.group == "new", "wait"]
b = d.loc[d.group == "standard", "wait"]
result = stats.ttest_ind(a, b, equal_var=False)
print(a.mean() - b.mean())
print(result.confidence_interval())
print(result.pvalue)The equal_var=False argument is essential to match the default Welch procedure in R. A different test may produce a different interval even when the mean difference agrees. Compare unrounded values using a numerical tolerance, then round only for presentation. Record the package versions and ensure that the Jupyter kernel belongs to the environment containing those packages.
16.4.3 Assignment and deliverables
Prepare a structured abstract, an IMRaD manuscript, a bibliography with verified references, a numbered figure and table, and a reproducibility statement. Include a supplementary methods document explaining the contrast and missing-data policy. Render HTML and an editable Word version, checking that mathematical notation and cross-references survive conversion. Provide a requirements file and a README. Do not invent ethics approval, funding, authorship or real patient recruitment.
16.4.4 Acceptance criteria
The numerical results must agree with Capstone 1 to the stated precision. References must resolve to real sources. The abstract and discussion must accurately reflect the results. If a format does not preserve a feature, provide a static alternative and document the difference.
16.5 Capstone 3: Interactive mathematics teaching module
16.5.1 Background and mathematical model
Consider the idealized tracer concentration \(C(t)=80e^{-kt}\), with time in hours and positive decay constant \(k\) in inverse hours. The half-life is obtained by setting the concentration equal to half its initial value:
\[ 80e^{-kt_{1/2}}=40,\qquad t_{1/2}=\frac{\ln 2}{k}. \]
This model is mathematical, not a clinical dosing recommendation. A learner should predict the effect of doubling \(k\) before manipulating the graph. For \(k=0.2\), the half-life is about 3.47 hours; for \(k=0.4\), it is about 1.73 hours. The initial concentration remains fixed.
16.5.2 R implementation
t <- seq(0, 12, length.out=121)
k <- 0.2
plot(t, 80*exp(-k*t), type="l", xlab="Hours", ylab="Concentration")16.5.3 Python implementation
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 12, 121)
plt.plot(t, 80*np.exp(-0.2*t))
plt.xlabel("Hours")
plt.ylabel("Concentration")
plt.show()The R and Python figures are static computational alternatives. For live browser interaction, use Observable JavaScript, as demonstrated in the starter lesson. A reactive variable representing the decay constant drives both the graph and numerical half-life. Avoid a design in which the graph updates but the displayed answer remains stale.
16.5.4 Assignment and deliverables
Develop a lesson containing objectives, a motivating scenario, a prediction prompt, an interactive graph, two guided investigations, a formative quiz with explanatory feedback, and a static fallback. Include sequential R and Python implementations. Test the minimum, maximum and default control values. Verify keyboard navigation and provide a textual description of the graph. Include a PDF-friendly activity with enough information to solve the problems without the interactive widget.
16.5.5 Acceptance criteria
The graph and numerical display must agree at every tested value. The activity must require mathematical reasoning, not merely moving a slider. The fallback must preserve the learning objective. The lesson should work on static hosting after rendering, subject to its browser dependencies.
16.6 Capstone 4: Academic website and research portfolio
16.6.1 Background
A professional academic website is an organized collection of resources rather than a collection of unrelated pages. Design the information architecture around the visitor’s needs. A student may seek course materials; a collaborator may seek research interests and publications; a reader may seek a textbook or dataset.
Create a Quarto website with a home page, research page, teaching page, publication list and resource page. The starter website contains three pages; extend it to meet the full specification. Use verified professional details or clearly labeled fictional content. Do not include private contact details or copyrighted materials without authorization.
16.6.2 Assignment and deliverables
Create a navigation bar, consistent theme, accessible headings, meaningful page titles, a publication listing and links to at least two reproducible resources. Add a short research note that explains a quantitative result and links to its source. Include a maintenance guide identifying how to add a publication, update a course link and regenerate the website.
Test navigation from every page, including narrow mobile layouts. Check that internal links use relative paths and that images have alternative text. A successful local preview does not guarantee correct behavior under a deployed subpath. Inspect the public build if you choose to publish it.
16.6.3 Acceptance criteria
All internal links must resolve. The website must distinguish sample content from verified claims. Navigation must be usable by keyboard, and the visual hierarchy must remain legible on a small screen. The project should render as an independent website without modifying the main textbook configuration.
16.7 Capstone 5: Computational textbook and automated publishing
16.7.1 Background
The final project integrates book organization, mathematical typesetting, computation, version control and deployment. Develop a miniature textbook with at least two substantive chapters, a preface, an appendix, references, exercises and a consistent visual identity. The starter book contains one sample chapter and a validation script; it is intentionally incomplete so that readers design their own publication.
16.7.2 Publishing workflow
Maintain the editable source on the main branch. Create a revision branch for a new chapter or correction. Run numerical checks, render the HTML edition, inspect figures and cross-references, and review the changes before merging. Tag a reviewed release. The supplied GitHub Actions example builds on pull requests and deploys only from the main branch outside pull requests. Enable GitHub Actions as the Pages source in the repository settings before attempting deployment.
python check.py
quarto render --to html
quarto render --to pdfA PDF build requires a compatible TeX installation. The HTML edition can be deployed to a static host; the rendered output must include its supporting assets. Quarto’s publishing documentation describes direct and CI-based publishing options. Select a platform according to access requirements and the maintenance burden, not simply because it is familiar.
16.7.3 Assignment and deliverables
Supply the complete source repository, a chapter template, separate R and Python investigations, a dataset or explicit synthetic data generator, a bibliography, an HTML build, a PDF build or documented blocker, a validation script, a release checklist and a deployment workflow. Include a README explaining how to reproduce the publication. If public deployment is inappropriate, demonstrate a local build and describe the intended deployment process instead.
16.7.4 Acceptance criteria
The project must build independently, contain consistent numbering and references, and have no secrets or confidential data in the source or output. The automated workflow must validate before deployment. A failed check should prevent release. Test the published URL, nested chapter links, images, and downloadable resources if deployment is performed.
16.8 Capstone 6: A multi-book academic publishing platform
16.8.1 Scenario and scope
An academic department wishes to publish a collection of independently maintained educational resources. Book 1 and Book 2 are approved for publication, while Book 3 is still under development. The department wants a single catalog through which readers can discover the approved books without requiring every author to use the same computational environment. Design a platform that makes publication status explicit and allows one book to be updated without inadvertently changing the others.
Start with the linked-site architecture from Chapter 15. It is simpler to diagnose than a reverse proxy because each book owns its own navigation and assets. For the local demonstration, assemble complete static directories under a shared root. This is a teaching fixture, not a claim that the resulting architecture implements a production proxy. An advanced submission may use independent hosting after obtaining permission and documenting the additional operational requirements.
16.8.2 Catalog as a publication contract
Maintain a JSON catalog with a unique slug, display title, status, edition and destination for each book. The slug is a stable identifier, not a title that changes whenever an editor revises the cover. Use book-1, book-2 and book-3. A draft entry can appear as a non-clickable announcement, but must not expose a draft artifact. Do not rely on hiding a link to protect confidential content: exclude private material from the public artifact altogether.
The catalog and each release record must agree. For example, if Book 1 is listed as edition 1.1.0 but its landing page identifies edition 1.0.0, readers cannot reliably cite the publication. Treat this discrepancy as a failed acceptance test. Keep the catalog version separate from individual book versions, since updating the catalog need not imply that all books have changed.
16.8.3 Build and validate
The starter laboratory in examples/ch16/portal uses only Python’s standard library. Run python practice.py from that directory. It creates temporary publication artifacts, validates the catalog, assembles approved books, checks local HTML links and image references, and records a SHA-256 manifest. It then deliberately removes an asset, verifies that the audit detects the failure, restores the previous artifact, and checks its integrity. No remote deployment occurs.
For a full submission, replace the fixture pages with independently rendered Quarto books. Each source project should contain an index page and at least two substantive chapters. Use a shared visual template but allow independent dependencies. Include a navigation link back to the catalog and a relative image reference in a nested chapter. Verify both links after assembly. The official Quarto book structure guide and book output guide provide the configuration reference for the source projects.
16.8.4 Release experiment
Record the initial artifact manifest. Revise one sentence in Book 2, render that book again, and assemble a candidate release. Compare the candidate and baseline manifests by relative path. Identify changed, added and removed files. A hash change indicates different bytes, not necessarily an error; review the change in context. Conversely, unchanged hashes do not prove scientific validity. They establish that the recorded files are byte-for-byte unchanged.
Test a failed release by removing a required figure. The candidate should fail validation, while the previous approved artifact remains intact. Restore the figure and repeat the test. For actual deployment, record the hosting provider’s rollback mechanism and test it in a preview environment rather than deliberately breaking a public site.
16.8.5 Deliverables and acceptance criteria
Submit the three source project descriptions, two complete published book artifacts, a catalog, a build script, a validation report, an edition manifest, and a maintenance guide. Book 3 may be represented by metadata only. Include a diagram showing the boundary between authoring repositories and public artifacts. A reviewer must be able to reproduce the local release without credentials. If a public URL is provided, verify nested pages, search, assets and keyboard navigation in a browser. Clearly distinguish local tests from actual hosting evidence.
16.9 Integrative project planning laboratory
16.9.1 Establish evidence before implementation
A capstone charter should distinguish requirements from preferences. A correct confidence interval is a requirement; a particular shade of blue is usually a preference. Record the acceptance test for each requirement before implementing the project. This prevents the final assessment from becoming a subjective judgment of polish. For each requirement, name the evidence, the reviewer and the expected result. If a test cannot be run, record the reason and the remaining risk rather than marking it as passed.
| Requirement | Evidence | Acceptance condition |
|---|---|---|
| Correct statistical contrast | Independent numerical check | New minus standard equals -5.375 |
| Correct mathematical model | Hand derivation and executable test | Half-life equals log(2)/k for positive k |
| Portable publication | Clean-directory build | No undocumented machine-specific paths |
| Accessible lesson | Keyboard and static review | Essential task can be completed without a mouse or animation |
| Approved catalog | Artifact inventory | Draft book absent from public files |
16.9.2 A staged development schedule
In week one, write the charter, establish the data provenance and create a minimal rendering prototype. In week two, develop the analysis or instructional mathematics, including independently checked benchmark values. In week three, construct the narrative, figures and interaction. In week four, perform a clean build and peer review, correct defects and document the release. The schedule is illustrative; a semester project can allocate more time to literature review, accessibility and independent reproduction.
Avoid postponing rendering until the end. A small early build reveals missing packages and unsupported format options before the manuscript becomes large. Equally, avoid spending the first week adjusting fonts while the estimand or learning objective remains undefined. A useful prototype contains one representative equation, figure, table and executable example.
16.10 Extended acceptance laboratories for Projects 1–5
16.10.1 Project 1: Statistical sensitivity and interpretation
The full synthetic clinic dataset remains the primary analysis. Removing the largest new-group value, 19, leaves seven observations with mean 14, compared with the standard mean 20. The resulting contrast is -6 minutes. Compute a new Welch interval using the revised sample variance and degrees of freedom; do not simply shift the original interval. Explain that this is a deliberately selected sensitivity scenario and not a defensible exclusion rule. A reviewer should ask whether the original observation was erroneous, not whether its removal improves the p-value.
16.10.2 Project 2: Cross-language agreement
Create a machine-readable result record with group counts, means, sample standard deviations, contrast, standard error, degrees of freedom, confidence limits and p-value. Compare R and Python values at a stated numerical tolerance, such as an absolute difference of \(10^{-8}\) for these small-scale results. Compare full precision values before formatting. A sign reversal may leave a two-sided p-value unchanged, so agreement in p-values alone is insufficient. Include a deliberate contrast reversal test and explain its effect on the confidence interval.
16.10.3 Project 3: Learning rather than decoration
For the exponential decay investigation, ask students to predict the effect of doubling the decay constant before moving a slider. With initial concentration fixed, doubling the positive constant halves the half-life. Require a written explanation based on \(t_{1/2}=\log(2)/k\), followed by a transfer problem with a new parameter. Test the control at its minimum and maximum, and reject nonpositive decay constants in a half-life calculation. Provide a table of three representative values and a labeled static graph for readers who cannot use the interaction.
16.10.4 Project 4: Reader journeys
Define three representative tasks: locate a research output, locate a teaching resource, and find contact or attribution information. Ask a reviewer to complete each task without coaching. Record the route, any misleading labels and any inaccessible controls. A website that looks attractive but conceals the resources it is intended to communicate has failed its central purpose. Use fictional profile information in the starter project and replace it only with information approved for publication.
16.10.5 Project 5: Multi-format editorial review
Select a representative equation, a cross-chapter reference, a long code block and a figure with a caption. Inspect each in HTML and PDF, and in Word or EPUB if required. In HTML, test navigation and narrow-screen layout. In PDF, inspect page breaks, mathematical glyphs and figure placement. In Word, check editable equations and table widths. In EPUB, check reflow and the static alternative to interactive material. Record each format separately; an untested format is not an approved deliverable.
16.11 Independent handoff and assessment
Exchange projects with a peer who has not seen the implementation. The reviewer should follow only the README, record the environment, run the prescribed checks and reproduce a benchmark. The author should not silently repair the reviewer’s machine or supply undocumented commands. Instead, record the missing step and revise the instructions. A second review should start from a fresh copy so that generated files from the first attempt cannot conceal a missing dependency.
Use the common 100-point rubric for each of the six projects. For technical correctness, require explicit numerical or functional evidence. For reproducibility, distinguish a source archive from a complete clean-build procedure. For communication, assess the intended reader’s task rather than the number of visual effects. For validation, reward honest documentation of untested components, while recognizing that an untested required feature cannot earn full credit. The professional handoff should identify who maintains the project, how corrections are reported and which version is approved.
16.12 Extended review and transfer exercises
- Write a measurable acceptance criterion for each of the six capstones.
- Calculate the revised new-group mean after omitting 19 and explain why the revised interval must be recomputed.
- Explain what changes when the Welch contrast is reversed and what remains unchanged.
- Derive the half-life for a positive decay constant and evaluate it at 0.4.
- Design a static equivalent of a slider-based lesson that still requires student reasoning.
- Explain why an unpublished book must be excluded from a public artifact rather than merely unlinked.
- Distinguish an artifact hash from evidence of scientific correctness.
- Describe a test that detects a missing image in a nested chapter.
- Design a release experiment that changes only Book 2 and records the resulting file differences.
- Prepare an independent handoff report distinguishing passed, failed and untested requirements.
16.13 Common assessment rubric
Apply this rubric separately to each capstone. Instructors may adjust weights before assigning the project.
| Criterion | Points | Full-credit evidence |
|---|---|---|
| Question and audience | 10 | Clear purpose, scope and appropriate deliverables |
| Technical correctness | 25 | Valid mathematics, analysis or implementation |
| Reproducibility | 25 | Source, dependencies, data and clean-build instructions |
| Communication and design | 20 | Clear narrative, accessible figures and usable structure |
| Validation and limitations | 15 | Documented tests, assumptions and honest limitations |
| Professional handoff | 5 | Organized files, version and maintenance instructions |
| Total | 100 |
Award partial credit proportionally to demonstrated evidence. A polished appearance cannot compensate for incorrect numerical results. Conversely, a correct calculation without a reproducible source is incomplete. Require a short demonstration in which the learner explains a design decision and reproduces one key result.
16.14 Guided practice
- Write a charter for one capstone, identifying the intended audience and three acceptance tests.
- Compare the R and Python Welch results. Explain why the sign of the estimate matters and why matching rounded p-values alone is insufficient.
- Change the decay constant to 0.35. Predict the half-life before checking the interactive lesson.
- Inspect the publishing workflow. Identify the event that triggers validation and the condition that prevents deployment from pull requests.
16.15 Troubleshooting and final review
If a build fails, reproduce the failure locally, identify the first meaningful error, and check the working directory and dependencies before editing the manuscript. If results disagree, compare input data, group definitions, missing-value handling and statistical options. If a deployed page lacks styling, inspect asset paths and the output directory. If a widget fails in PDF, provide a static alternative rather than promising unsupported interactivity.
Before release, ask a reviewer unfamiliar with the project to follow the README. Record any undocumented steps they encounter. Check that figures, tables, code and narrative refer to the same data version. Verify permissions, licenses, accessibility and privacy. Archive the reviewed source revision and record the date and version of the release.
16.16 Chapter summary
The six capstones demonstrate a shared workflow: define a question, build an appropriate source project, validate its results, communicate clearly, and release responsibly. Reproducibility is a practice of documenting and testing decisions, not merely selecting a software tool. A professional publication makes its assumptions and limitations visible and provides a credible path for future revision.
16.17 Review exercises
- Distinguish a reproducible build from a valid scientific conclusion.
- Explain why relative paths matter.
- Identify the estimand in Capstone 1.
- Explain why Welch’s procedure is appropriate for unequal variances.
- Interpret the negative estimated contrast.
- Explain why synthetic results cannot justify a clinical recommendation.
- Identify the Python argument that selects Welch’s test.
- Explain why package versions should be recorded.
- Derive the exponential half-life formula.
- Describe a useful static fallback for the interactive lesson.
- Explain why a public website needs a privacy review.
- Distinguish a source repository from a rendered website.
- Explain why deployment should follow validation.
- Describe how a release tag supports textbook maintenance.
- Identify three accessibility checks for an academic website.
- Explain how peer review can reveal undocumented dependencies.
16.18 Further reading
16.19 Supplemental assessment
- Conceptual (4 points). Distinguish technical success from scientific validity.
- Technical (8 points). Choose one of the six capstones and write three measurable acceptance criteria.
- Applied (8 points). Prepare a reproducible handoff and peer review of the chosen project.
See the student assessment packet in the source package for submission guidance and any required datasets.
16.20 Looking ahead
Use the appendices as reference guides and Appendix H to evaluate the final release.
16.21 Interactive learning lab
Explore the activity below, then explain what changed and why.