> For the complete documentation index, see [llms.txt](https://globalimpact.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://globalimpact.gitbook.io/untitled/methodological-discussion/analysis-statistical-approaches.md).

# Analysis: Statistical approaches

What to do with the data after you collect it (and what you should put in a pre-analysis-plan).

## Impact of treatment on 'rare event' incidence

*Notes from slack:*

> I’m finding some issues like this in analyzing rare events … not quite that rare, but still a few per thousand or a few per hundred.
>
> I’m taking 2 statistical approaches to the analysis (discussion, code, and data in links):

1. [Bayesian binomial-beta (a pretty standard setup I’m probably making overcomplicated)](https://daaronr.github.io/dualprocess/analysis-questions-and-tests.html#bayes_prop)
2. Randomization inference (simulation) … for a sort of [equivalence testing here](https://rethinkpriorities.github.io/methodology-statistics-design/inference-and-rough-equivalence-testing-with-binomial-outcomes.html#how-likely-are-proportions-this-similar-under-different-size-true-effect-sizes)

> I think either of these could be ‘flipped around’ to be used for power calculation or ‘the Bayesian equivalent of power calculation’

> My colleague Jamie Elsey has some expertise with the latter; [we’re putting together our discussion HERE](https://rethinkpriorities.github.io/methodology-statistics-design/power-workflow.html), although it’s mainly frequentist and not Bayesian ATM.

## Open and robust science: Preregistration and Preanalysis plans

There are reasons 'some pre-registration' or at least 'declaring your intentions in advance' is worth doing even if you aren't aiming at scientific publication

## Which statistical tests/methods

<https://gitlab.com/dsbowen/conditional-inference/-/blob/master/examples/bayes_primer.ipynb>

## [From Sample to Population: Multilevel Regression and Poststratification (MRP) and Survey Weighting](https://docs.google.com/document/d/14uTZqOpnKAK8_oRwgqlAhEXfyQPQUKK9/edit)

{% embed url="<https://docs.google.com/document/d/14uTZqOpnKAK8_oRwgqlAhEXfyQPQUKK9/edit>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://globalimpact.gitbook.io/untitled/methodological-discussion/analysis-statistical-approaches.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
