-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
56 lines (42 loc) · 1.48 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
output: github_document
---
<!--
README.md is generated from README.Rmd. Please edit that file
knitr::knit("README.Rmd")
-->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "tools/README-"
)
```
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/logitnorm)](http://cran.r-project.org/package=logitnorm)
[![Travis-CI Build Status](https://travis-ci.org/bgctw/logitnorm.svg?branch=master)](https://travis-ci.org/bgctw/logitnorm)
## Overview
`logitnorm` package provides support for the univariate
[logit-normal
distribution](https://en.wikipedia.org/wiki/Logit-normal_distribution). In
addition to the usual random, density, percential, and quantile function, it
helps with estimating distribution parameters from observations statistics.
## Installation
```{r, eval = FALSE}
# From CRAN
install.packages("logitnorm")
# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("bgctw/logitnorm")
```
## Usage
See the package vignette for an introduction.
A simple example estimates distribution parameters from observation
statistics of mode 0.7 and upper quantile 0.9. Next, the density is
computed and plotted across a range of quantiles.
```{r example}
(theta <- twCoefLogitnormMLE(0.7,0.9))
x <- seq(0,1, length.out=81)
d <- dlogitnorm(x, mu=theta[1,"mu"], sigma=theta[1,"sigma"])
plot(d~x,type="l")
abline(v=c(0.7,0.9), col="grey")
```