DISTRIB-package: Four Essential Functions for Statistical Distributions...

Description Author(s) Examples

Description

Previously, four useful functions dnorm, pnorm, qnorm and rnorm are introduced for any univariate distribution in package stats. But the name of these functions are different for any distribution, for example compare the names of dcauchy and dchisq which are for Cauchy and Chi-square distributions, respectively. Now suppose that you have a fixed formula which you want to work with any distribution. To this matter, the author of this package try to define four functions pdf, cdf, rd and q in package DISTRIB, in which the user is able to consider the name of distribution as a argument of them, and therefore these functions can work with any arbitrary distribution.

Author(s)

Abbas Parchami

Maintainer: Abbas Parchami <parchami@uk.ac.ir>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# An applied example for computing p-value in testing H0: mu>=0, vs, H1: mu<0 with two 
# different test statistic distribution: 

# (a) where the statistics test is T~N(0,1) and its observed value is t = -1.5
p_value = cdf(T.dist="norm", T.dist.par=c(0,1), t=-1.5)
print(p_value)

# (b) where the statistics test T has t-student dist. with 10 degree of freedom 
#     and its observed value is t = -1.5
p_value = cdf(T.dist="t", T.dist.par=10, t=-1.5) 
print(p_value)

DISTRIB documentation built on May 2, 2019, 2:51 p.m.