
---
title: "Introduction to PropTestR"
author:
  - "Vinodhkumar Obli Rajendran"
  - "Keerthi Aaradhana"
output:
  rmarkdown::html_vignette:
    toc: true
vignette: >
  %\VignetteIndexEntry{Introduction to PropTestR}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}

---

```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse=TRUE, comment="#>")
```

## Overview

PropTestR provides a common interface for independent two-proportion inference. The principal function is `compare_2prop()`.

```{r}
library(PropTestR)
r <- compare_2prop(82, 100, 75, 100, method=c("wald","score","fisher","miettinen_nurminen"))
print(r)
```

## Non-inferiority

For a non-inferiority margin of 10 percentage points, use a null difference of -0.10 and a one-sided greater alternative.

```{r}
farrington_manning(82, 100, 85, 100, margin=-0.10, alternative="greater")
```

## Equivalence

```{r}
equivalence_2prop(80, 100, 78, 100, margin=0.10, conf.level=0.90)
```
