Lesson 1: Random Variables and Discrete Distributions

Mean

Formula
Population \[ \large \mu = \frac{1}{N} \sum_{i=1}^N x_i \]
Sample \[ \large \bar{x} = \frac{1}{n} \sum_{i=1}^n x_i \]

Variance

Formula
Population \[ \large \sigma=\frac{1}{N} \sum_{i=1}^N (x_i-\mu)^2 \]
Sample \[ \large s^2=\frac{1}{n-1}\sum_{i=1}^n (x_i - \bar{x})^2 \]

Standard Deviation

Formula
Population \[ \large \sigma = \sqrt{\sigma ^2} \]
Sample \[ \large s=\sqrt{s^2} \]

Combination Rule

\[ \large \binom{n}{k}=\frac{N!}{n!(N-n)!} \]

Empirical Rule

\[ \large {P\left ( -\sigma<X-\mu<\sigma \right ) \approx .68 \\ P\left ( -2\sigma<X-\mu<2\sigma \right ) \approx .95\\ P\left ( -3\sigma<X-\mu<3\sigma \right ) \approx .99} \]

Binomial Probabilities

\[ P\left ( X=k\right)=\binom{n}{k}p^k \left ( 1-p \right )^{n-k}\\ \binom{n}{k}=\frac{n!}{k!\left (n-k\right)!} \]

R commands

Basic

Statistic formula
Mean mean(dataframe$variable)
Standard Deviation sd(dataframe$variable)
Summary summary(dataframe$variable)

Examples

mean(cars$speed)
## [1] 15.4
sd(cars$speed)
## [1] 5.287644
summary(cars$speed)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     4.0    12.0    15.0    15.4    19.0    25.0

Binomial Probability Distribution

p=probability of success each experiment
n=number of experiments
Statistic Formula
Probability of x successes dbinom(x,n,p)
Probability of at most x successes pbinom(x,n,p)

Lesson 2: Continuous distributions and the Normal distribution

Standardization

\[ Z=\frac{X-\mu}{\sigma} \]

R commands

m=mean, sd=standard deviation, p=probability
Col1 Col2
Value of the normal density function at point x with given parameters dnorm(x,m,sd)
Probability that a normal random variable is less than x pnorm(x,m,sd)
A normal random variable is less than this value with the given probability p qnorm(p,m,sd)

Lesson 3: Central limit theorem and Confidence intervals

Sample Standard Deviation

\[ s=\sqrt{\frac{1}{n-1} \sum_{i=1}^{n} \left ( X_i - \bar X \right )^2} \]

Standard Deviation of a Sample Mean

\[ \sigma_{\bar x} = \textrm{SD} \left ( \bar X \right ) = \frac{\sigma}{\sqrt{n}} \]

Central Limit Theorem

\[ \bar X \sim N \left ( \mu , \frac{\sigma}{\sqrt{n}}\right ) \]