- Stats Calculator
- Properties
- Math Operations
- Addition - Calls addition static method
- Subtraction - Calls subtraction static method
- Multiplication - Calls multiplication static method
- Division - Calls division static method
- Square - Calls square static method
- Square Root - Calls square root static method
- Random Generator
- listPick Methods
- return random choice
- use seed
- use RandomGenerator.randNum to generate list
- listPick Methods
- Population Sampling Functions
- randomSampling
- confidenceInterval
- marginOfError
- cochranFormula
- sampleSize
- Descriptive Statistics Functions
-
Random Generator Function
- Description: The random module uses the seed value as a base to generate a random number. if seed value is not present it takes system current time.
- Tasks
- without a seed between a range of two numbers
- with a seed between a range of two numbers(integer and decimal
- generate a list of n random numbers
- selecting random item from list
- setting a seed and randomly select
- selecting n number of items from a list without a seed
- selecting n number of items from a list with a seed
- Use Functions (make sure to import the random module)
.seed()
used to initialize the random number generator..random()
for generating random floats.randint()
for generating random integers.randrange()
for generating random numbers within a range.choice()
for randomly selected element
-
Populating Sampling Functions
- Description: Computing statistical functions using statistics module
- Tasks
- Simple random sampling
- Confidence Interval For a Sample
- Margin of Error
- Cochran’s Sample Size Formula
- How to Find a Sample Size Given a Confidence Interval and Width (unknown population standard deviation)
- Use functions
.sample()
to choose sample/multiple items from a Python list, set, and dictionary.scipy.stats.t.interval()
to find the confidence interval of a sample statistic
-
Descriptive Statistics Functions
- Description: Creating functions for basic stats operations
- Mean
- Median
- Mode
- Variance
- Standard Deviation
- Z-Score
- Use functions:
- Use
import numpy
See examplenp.mean()
np.median()
np.mode()
np.var()
np.std()
.stats.zscore
Make sure tofrom scipy import stats
- Use
- Description: Creating functions for basic stats operations
- Travis Build
- Remove Print Statements
- Complete other methods
- https://pynative.com/python-random-sample/
- https://www.kite.com/python/answers/how-to-compute-the-confidence-interval-of-a-sample-statistic-in-python
- https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.zscore.html
- https://numpy.org/doc/stable/reference/generated/numpy.std.html
- https://numpy.org/doc/stable/reference/generated/numpy.var.html