6. API Example¶
6.1. rnorm
¶
reStructuredText:
.. automodule:: statspy.basics
:members: rnorm
Results:
-
statspy.basics.
rnorm
(n, mean=0, sd=1)[source]¶ Random generation for the normal distribution with mean equal to mean and standard deviation equation to sd same functions as rnorm in r:
rnorm(n, mean=0, sd=1)
Parameters: - n – the number of the observations
- mean – vector of means
- sd – vector of standard deviations
Returns: the vector of the random numbers
Author: Wenqiang Feng
Email:
6.2. dnorm
¶
reStructuredText:
.. automodule:: statspy.basics
:members: dnorm
:noindex:
Results:
-
statspy.basics.
dnorm
(x, mean=0, sd=1, log=False)[source] Density of the normal distribution with mean equal to mean and standard deviation equation to sd same functions as rnorm in r:
dnorm(x, mean=0, sd=1, log=FALSE)
Parameters: - x – the vector od quantiles
- mean – vector of means
- sd – vector of standard deviations
Returns: the list of the density
Author: Wenqiang Feng
Email:
6.3. runif
¶
reStructuredText:
.. automodule:: statspy.basics
:members: runif
:noindex:
Results:
-
statspy.basics.
runif
(n, min=0, max=1)[source] Random generation from the uniform distribution same functions as rnorm in r:
runif(n, min=0, max=1)
Parameters: - n – the number of the observations
- min – the lower limit of the distribution
- max – the upper limit of the distribution
Returns: the list of n uniform random numers
Author: Wenqiang Feng
Email:
6.4. T-test
¶
reStructuredText:
.. automodule:: statspy.tests
:members:
Results:
-
statspy.tests.
t_test
(x, y=None, mu=0.0, conf_level=0.95)[source]¶ Performs one and two sample t-tests on vectors of data.
same functions as t.test in r:
t.test(x, ...)
t.test(x, y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, var.equal = FALSE,
conf.level = 0.95, ...)
Parameters: - x – a (non-empty) numeric vector of data values.
- y – an optional (non-empty) numeric vector of data values.
- mu – vector of standard deviations.
- conf_level – confidence level of the interval.
Returns: the vector of the random numbers.
Author: Wenqiang Feng
Email: