GW PSC Workshop · October 6, 2026

CS 101 for Political Scientists

Alperen Keles

alperenkeles.com · [email protected]

Today

  1. What happens when you render a .qmd / .rmd into a PDF?
  2. How do you coordinate edits and maintain long-term projects?
  3. Pitfalls and leverage points of using AI in research

Representation

Computer science is about representation and expressivity

BaseRepresentation
10 (decimal)1776
2 (binary)11011110000
8 (octal)3360
16 (hexadecimal)6F0

From numbers to letters: ASCII

Agree on a table: every character gets a number.

CharacterDecimalHexBinary
V865601010110
O794F01001111
T845401010100
E694501000101

Unicode & UTF-8

CharacterCode pointUTF-8 bytes
AU+004141
çU+00E7C3 A7
şU+015FC5 9F
中U+4E2DE4 B8 AD
🗳️U+1F5F3F0 9F 97 B3

150,000+ characters, 1–4 bytes each. Plain ASCII text is already valid UTF-8.

One document, many representations

Timing and Turnout in Off-Cycle Governor Elections

1  Introduction

Five American states elect their governors in odd-numbered years. We ask whether this timing changes who shows up.

Off-cycle elections lower turnout (Anzia 2011).

  • turnout.csv: state-level governor elections
  • survey.dta: a Stata survey
Markdown

---
title: "Timing and Turnout in Off-Cycle Governor Elections"
author: "CS 101 for Political Scientists"
---

# Introduction

Five American states elect their governors in
odd-numbered years. We ask whether this *timing*
changes **who shows up**.

Off-cycle elections lower turnout [@anzia2011election].

- `turnout.csv`: state-level governor elections
- `survey.dta`: a Stata survey
              
HTML
LaTeX

\title{Timing and Turnout in Off-Cycle Governor Elections}
\author{CS 101 for Political Scientists}
\begin{document}
\maketitle

\section{Introduction}
Five American states elect their governors in
odd-numbered years. We ask whether this \emph{timing}
changes \textbf{who shows up}.

Off-cycle elections lower turnout \citep{anzia2011election}.

\begin{itemize}
  \item \texttt{turnout.csv}: state-level governor elections
  \item \texttt{survey.dta}: a Stata survey
\end{itemize}
              

Part 1

From .qmd to PDF

Editing in a WYSIWYG editor

paper.docx
Normal
Heading 1
Heading 2

Editing in LaTeX

paper.tex

Textual vs. Binary Formats

Textual

Binary

Markdown → LaTeX → PDF

paper.md

---
title: "Timing and Turnout in Off-Cycle Governor Elections"
author: "CS 101 for Political Scientists"
---

# Introduction

Five American states elect their governors in
odd-numbered years. We ask whether this *timing*
changes **who shows up**.

Off-cycle elections lower turnout [@anzia2011election].

- `turnout.csv`: state-level governor elections
- `survey.dta`: a Stata survey
              
pandoc→
paper.tex (preamble omitted)

\title{Timing and Turnout in Off-Cycle
Governor Elections}
\author{CS 101 for Political Scientists}
\date{}

\begin{document}
\maketitle

\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}

Five American states elect their governors
in odd-numbered years. We ask whether this
\emph{timing} changes \textbf{who shows up}.

Off-cycle elections lower turnout
\citep{anzia2011election}.

\begin{itemize}
\tightlist
\item
  \texttt{turnout.csv}: state-level governor
  elections
\item
  \texttt{survey.dta}: a Stata survey
\end{itemize}

  \bibliography{references.bib}

\end{document}
              
pdflatex
+ bibtex
→
paper.pdf
Rendered PDF page

R Markdown → Markdown → LaTeX → PDF

paper.rmd

---
title: "Timing and Turnout"
output: pdf_document
---

```{r setup, include=FALSE}
source("analysis/clean.R")
```

# Data

- `turnout.csv`: `r nrow(turnout)` elections
- `survey.dta`: `r nrow(survey)` respondents

# Results

Off-cycle turnout is
**`r sprintf("%.1f", turnout_gap)` points lower**.

```{r turnout-table, echo=FALSE}
knitr::kable(by_timing, digits = 1,
             format = "latex", booktabs = TRUE)
```
              
knitr→
paper.md

---
title: "Timing and Turnout"
output: pdf_document
---

# Data

- `turnout.csv`: 39 elections
- `survey.dta`: 300 respondents

# Results

Off-cycle turnout is
**16.0 points lower**.

\begin{tabular}{lrrrr}
\toprule
gov\_timing & states & elections & mean\_turnout & sd\_turnout\\
\midrule
off-cycle & 5 & 15 & 36.3 & 6.9\\
on-cycle & 8 & 24 & 52.3 & 4.7\\
\bottomrule
\end{tabular}
              
pandoc→
paper.tex

\title{Timing and Turnout}
\author{}
\date{}

\begin{document}
\maketitle

\hypertarget{data}{%
\section{Data}\label{data}}

\begin{itemize}
\tightlist
\item
  \texttt{turnout.csv}: 39 elections
\item
  \texttt{survey.dta}: 300 respondents
\end{itemize}

\hypertarget{results}{%
\section{Results}\label{results}}

Off-cycle turnout is \textbf{16.0 points
lower}.

\begin{tabular}{lrrrr}
\toprule
gov\_timing & states & elections & mean\_turnout & sd\_turnout\\
\midrule
off-cycle & 5 & 15 & 36.3 & 6.9\\
on-cycle & 8 & 24 & 52.3 & 4.7\\
\bottomrule
\end{tabular}

\end{document}
              
pdflatex→
paper.pdf
Rendered PDF page

Part 2

Collaboration & Long-Term Projects

PaperFinalFinalFinal3.docx

Git commands

Start

start tracking a folder
copy a project
say who you are

Record

what's going on?
what exactly changed?
pick what to save
save a snapshot
browse the history
undo unsaved edits

Share

upload your commits
get others' commits

Branch

move between versions
combine branches

One paper, two coauthors, one history

Part 3

AI in Your Research

Pitfalls and leverage points

Thank you

Questions?