mikenguyen13/data_analysis
Tentang
Streamline a data analysis process. A book on data analysis, causal inference, and econometrics, written for readers with little to no prior background who want to develop both statistical intuition and practical R skills.
Pembelajaran mesinPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- Mengumpulkan riwayat
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliA Guide on Data Analysis
A book on data analysis, causal inference, and econometrics, written for readers with little to no prior background who want to develop both statistical intuition and practical R skills. The print edition is published by Springer Cham as a four-volume series, and this repository hosts the open online edition that the print volumes are drawn from.
Read it online: https://mike-data-analysis.share.connect.posit.cloud/
What the book covers
The online edition runs from descriptive statistics through inference, regression, and causal inference, with a strong emphasis on the methods that have come to define modern empirical practice.
- Foundations: descriptive statistics, basic inference, hypothesis testing, sampling, ANOVA.
- Regression: OLS, GLS, MLE, penalized, robust, partial least squares.
- Generalized linear and mixed models: logistic, count, hierarchical.
- Modeling workflow: variable transformation, imputation, model specification, variable selection.
- Effects and decomposition: marginal effects, moderation, mediation, prediction vs. estimation.
- Causal inference: difference-in-differences with the modern staggered estimators (Goodman-Bacon, Callaway-Sant'Anna, Sun-Abraham, de Chaisemartin-D'Haultfoeuille, Borusyak-Jaravel-Spiess), regression discontinuity (incl.
rdrobust), interrupted time series, synthetic control, synthetic DiD, changes-in-changes, event studies, instrumental variables (incl. examiner designs and proxies), matching, and DAGs. - Sensitivity and robustness: specification curves, Oster coefficient stability, Cinelli-Hazlett robustness value (
sensemakr), Rosenbaum bounds. - Workflow and reporting: experimental design, EDA, reproducibility, synthetic data, HPC.
Table of contents
The book is organized into five parts plus an appendix. This section is auto-generated by tools/build-toc.R on every push — do not edit by hand.
Part I. Foundations
- Prerequisites
- Descriptive Statistics
- Basic Statistical Inference
Part II. Regression
- Linear Regression
- Non-Linear Regression
- Generalized Linear Models
- Discrete Choice and Limited Dependent Variables
- Tweedie Regression
- Linear Mixed Models
- Nonlinear and Generalized Linear Mixed Models
- Nonparametric Regression
- Quantile Regression and Distributional Methods
Part III. Ramifications
- Data
- Time Series Analysis
- Variable Transformation
- Imputation (Missing Data)
- Model Specification Tests
- Variable Selection
- Hypothesis Testing
- Marginal Effects
- Moderation
- Mediation
- Prediction and Estimation
Part IV. Causal Inference
- Causal Inference
- A. Experimental Design
- Experimental Design
- Interference and Spillover Effects
- Sampling
- Survey and Response Quality
- Analysis of Variance
- Multivariate Methods
- B. Quasi-Experimental Design
- Quasi-Experimental Methods
- Regression Discontinuity
- Temporal Discontinuity Designs
- Synthetic Difference-in-Differences
- Difference-in-Differences
- Changes-in-Changes
- Synthetic Control
- Event Studies
- Instrumental Variables
- Matching Methods
- Machine Learning for Causal Inference
- Uplift Modeling and Heterogeneous Treatment Effects
- Text as Data and NLP for Causal Inference
- C. Other Concerns
- Endogeneity
- Biases
- Directed Acyclic Graphs
- Controls
Part V. Miscellaneous
- Reporting Your Analysis
- Exploratory Data Analysis
- Sensitivity Analysis and Robustness Checks
- Replication and Synthetic Data
- Differential Privacy
- High-Performance Computing
- Clustered and Robust Inference
Part VI. Structural Econometrics
- Estimation Methods for Structural Models
- Structural Econometrics and Demand Estimation
- Dynamic Discrete Choice
- Dynamic Games
- Structural Models of Selection and Unobserved Heterogeneity
- Production Functions and Productivity
- Frontier and Efficiency Analysis
- Markups, Market Power, and Mergers
- Demand Systems
- Structural Models of Auctions
- Machine Learning and AI for Structural Estimation
- Structural Models in Marketing
- Branding and Brand Equity
- Structural Models in Finance
Appendix
A. Appendix B. Bookdown cheat sheet
Print edition (Springer Cham, 2025)
The book is published in four volumes by Springer Cham:
| Volume | Title | Identifier |
|---|---|---|
| 1 | Foundations of Data Analysis | DOI 10.1007/978-3-032-01858-8 |
| 2 | Regression Techniques for Data Analysis | ISBN 978-3-032-01834-2 |
| 3 | Advanced Modeling and Data Challenges | ISBN 978-3-032-01718-5 |
| 4 | Experimental Design | ISBN 978-3-032-01838-0 |
How to cite
Nguyen, M. (2025). Foundations of Data Analysis (Vol. 1). Springer Cham. https://doi.org/10.1007/978-3-032-01858-8
@book{Nguyen2025Vol1,
author = {Nguyen, Mike},
title = {Foundations of Data Analysis},
volume = {1},
year = {2025},
publisher = {Springer Cham},
doi = {10.1007/978-3-032-01858-8}
}
Citation entries for Volumes 2 to 4 are listed in the preface of the online edition.
Building locally
The book is built with bookdown and renders to HTML (gitbook), PDF (LuaLaTeX), and EPUB.
install.packages(c("bookdown", "rmarkdown"))
bookdown::render_book(input = "index.Rmd")
The PDF route requires a working LaTeX installation with LuaLaTeX. On Windows, TinyTeX or MiKTeX both work; on macOS, MacTeX; on Linux, TeX Live.
The repo uses renv for package version pinning. After cloning, run renv::restore() to recreate the package environment used by the book.
Deploying the online edition
The online edition is the bs4_book HTML in _book/. The same files are published to two hosts:
- GitHub Pages (
https://mikenguyen13.github.io/data_analysis/, branchgh-pages) is the canonical copy that search engines index. - Posit Connect Cloud (
https://mike-data-analysis.share.connect.posit.cloud/) keeps serving readers who arrive there, including every old bookdown.org link, which Posit redirects there.
Google indexes almost nothing on share.connect.posit.cloud: in Nov 2026, Search Console showed 1 of 161 pages indexed. So every page carries <link rel="canonical"> pointing at GitHub Pages. After rendering, run both pre-deploy steps from the repo root, then deploy _book/ to both hosts:
bookdown::render_book("index.Rmd", output_format = "bookdown::bs4_book")
source("gen_sitemap_posit.R") # llms.txt, redirect stubs -> _book/
system("Rscript redirects/set_canonical_host.R _book https://mikenguyen13.github.io/data_analysis/")
# canonical links, og:url, JSON-LD, sitemap.xml, robots.txt, .nojekyll
rsconnect::deployApp(appDir = "_book", appId = "019b4ef3-ffbb-c7d8-9465-334d7a28631e",
account = "mike", server = "connect.posit.cloud", contentCategory = "site")
Then publish the same _book/ to GitHub Pages as a single-commit orphan gh-pages branch. Leave out _book/rsconnect/. The .nojekyll file must be included, or GitHub Pages drops libs/ and the *_files/ folders. A force-push is fine here: gh-pages holds only the built site, and nothing else depends on its history.
Do not skip gen_sitemap_posit.R. Besides the sitemap, it copies the redirect stubs in redirects/ into _book/. The book moved from bookdown.org to Posit Connect Cloud in May 2026, and many chapter filenames changed. Each stub is a small HTML page (meta refresh, canonical link and location.replace) that sends an old bookdown.org filename to its new page or section. Without them, the old URLs that search engines still rank return 404, which is what cut traffic by about three quarters before the stubs went live.
redirects/redirect_map.jsonis the source of truth: old filename ->to(new page, optionally#section), plus how it was matched and the old title.redirects/stubs/*.htmlare generated from the map and committed. After editing the map, regenerate them withRscript redirects/build_redirects.R stubs.- A stub never overwrites a page the render produced. If a chapter later reuses an old filename, the real page wins and the pre-deploy step prints a warning. It also warns when a stub points at a page missing from
_book/. - Stubs are kept out of
sitemap.xml.
Repository layout
.
├── index.Rmd # title page and preface
├── 02-50*.Rmd # numbered chapters
├── _bookdown.yml # book configuration
├── _output.yml # output formats (gitbook, PDF, EPUB, bs4_book)
├── preamble.tex # LaTeX preamble for the PDF build
├── *.bib # bibliographies (book.bib, references.bib, packages.bib, references1.bib)
├── images/ # figures and cover art
├── data/ # datasets used in examples
├── renv/, renv.lock # pinned package environment
├── gen_sitemap_posit.R # pre-deploy step (sitemap, site files, redirect stubs)
├── redirects/ # old bookdown.org URL -> new page map and generated stubs
└── _book/ # rendered output (git-ignored)
Files prefixed with _ (e.g., _06.01-...) are draft fragments not included in the live book.
Errata
Spotted an error or have a suggestion? Please open an issue on this repository.
Author
Mike Nguyen, mikenguyen.netlify.app, GitHub @mikenguyen13.
License
The online edition is released under CC BY-NC-SA 4.0. The print editions of Volumes 1 to 4 published by Springer Cham (2025) are not covered by this license; all rights to the print editions are reserved by the publisher. See LICENSE for the full notice.
Jelajahi proyek terkait
Memuat…