Description Usage Arguments Details Value References See Also Examples

Density (mass), distribution function, quantile function, and random generation for the difference between two proportions. This is determined by taking the difference between two independent beta distributions.

1 2 3 4 5 6 7 |

`x, q` |
Vector of quantiles. |

`p` |
Vector of probabilities. |

`n` |
The number of observations. If |

`k1, k2` |
The number of successes drawn from groups 1 and 2, respectively. |

`n1, n2` |
The sample sizes for groups 1 and 2, respectively. |

`a1, a2` |
The shift parameters for the beta distributions. For the fiducial approach, we know that the lower and upper limits are set at |

`log, log.p` |
Logical vectors. If |

`lower.tail` |
Logical vector. If |

`...` |
Additional arguments passed to the Appell |

The difference between two proportions distribution has a fairly complicated functional form. Please see the article by Chen and Luo (2011), who corrected a typo in the article by Nadarajah and Kotz (2007), for the functional form of this distribution.

`ddiffprop`

gives the density (mass), `pdiffprop`

gives the distribution function, `qdiffprop`

gives the quantile function, and `rdiffprop`

generates random deviates.

Chen, Y. and Luo, S. (2011), A Few Remarks on 'Statistical Distribution of the Difference of Two Proportions', *Statistics in Medicine*, **30**, 1913–1915.

Nadarajah, S. and Kotz, S. (2007), Statistical Distribution of the Difference of Two Proportions, *Statistics in Medicine*, **26**, 3518–3523.

`runif`

and `.Random.seed`

about random number generation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
## Randomly generated data from the difference between
## two proportions distribution.
set.seed(100)
x <- rdiffprop(n = 100, k1 = 2, k2 = 10, n1 = 17, n2 = 13)
hist(x, main = "Randomly Generated Data", prob = TRUE)
x.1 <- sort(x)
y <- ddiffprop(x = x.1, k1 = 2, k2 = 10, n1 = 17, n2 = 13)
lines(x.1, y, col = 2, lwd = 2)
plot(x.1, pdiffprop(q = x.1, k1 = 2, k2 = 10, n1 = 17,
n2 = 13), type = "l", xlab = "x",
ylab = "Cumulative Probabilities")
qdiffprop(p = 0.20, k1 = 2, k2 = 10, n1 = 17, n2 = 13,
lower.tail = FALSE)
qdiffprop(p = 0.80, k1 = 2, k2 = 10, n1 = 17, n2 = 13)
``` |

tolerance documentation built on May 29, 2017, 5:30 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.