1  Chapter 1 - Headings

\(\definecolor{frog}{rgb}{1,0,0}\) \(\newcommand{\dx}{\,\text{d}x}\) \(\newcommand{\du}{\,\text{d}u}\) \(\newcommand{\dy}{\,\text{d}y}\) \(\newcommand{\dt}{\,\text{d}t}\)

Each row that begins with a # is a chapter heading. So if each chapter is a single file it’s best to only use a single # line at the top of each document.

1.1 Models for binary/binomial response

This chapter contains sections and subsections. This is the intro. Since the chapter title begins with a #, sections begin with ##, and subsections should begin with ###.

Typical default numbering will look like this:

Chapter 1
Section 1.1
Subsection 1.1.1
Subsection 1.1.2
Section 1.2
Subsection 1.2.1
Subsection 1.2.2
Subsection 1.2.3
Section 1.3

The crossref option in your global .yml file does offer the chance to not number any chapters and just have sections in each chapter, if you really don’t want chapters.

1.1.1 First subsection

Text goes here.

1.1.2 Second subsection

Text goes here. And we can reference whole sections if we wish, like Section 1.1. Indeed if you look in Chapter 3.

Let

\[D_3(y) \equiv \frac{\!\textrm{d}^{3} y}{\textrm{d}x^{3}}\]

That was just an equation inside $$ and $$ tags. Equations must be defined like this, they can be labelled (unlike in LaTeX). You should also avoid using LaTeX environments which begin math mode, like align, instead use the -ed version aligned which assumes you’re already inside math mode.

\[ \int_0^{\infty} x^3 \dx \tag{1.1}\]

Here’s some more text

  • here’s bullet point \(x+y=z\)

  • another bullet

More text.

1.2 Section title

Here’s some sample text from Advanced Predictive Models.

We will begin with models for binomial responses and we will look at exploratory plots of the data, different choices of link function and hypothesis tests about terms in the model. Finally we will examine measures of goodness of fit of the model. Let’s begin with an example.

TipBeetle mortality

This is standard Quarto a “Tip Callout” box called via

:::{.callout-tip}
### Banner title like Bettle Mortality

Content here. This gives coloured boxes in HTML and LaTeX.
:::

However, see Chapter 4 for my recommended alternative to these callout boxes.

Now for a default code panelset as Quarto calls it. For allowing dual code presentation. See Chapter 2 for my restyled version.

Code
beetles <- read.csv(url("http://www.stats.gla.ac.uk/~tereza/rp/beetles.csv"))
beetles
    dose number killed
1 1.6907     59      6
2 1.7242     60     13
3 1.7552     62     18
4 1.7842     56     28
5 1.8113     63     52
6 1.8369     59     53
7 1.8610     62     61
8 1.8839     60     60
import pandas as pd
beetles = pd.read_csv("beetles.csv")
beetles

This Python code was told not to evaluate. Note it calls a local csv file, which would need to be in the right place. Paths will be relative to the .qmd file being compiled.