MGCR 271 Crib Sheet By Kareem Halabi Z-score: π§ =
π₯βπ₯ π π₯
(if |π§| > 3 then the number
is an outlier). All the z scores of a data set will have π₯ = 0, π π₯ = 1 Simple Regression: Residual for (ππ , ππ ): ππ = π¦π β π β ππ₯π Ordinary Least Squares regression: Goal is to minimize β ππ 2 π¦ = π + ππ₯ π=
π(β π₯π¦)β(β π₯)(β π¦) π(β π₯ 2 )β(β π₯)
2
π=
(β π¦)βπ(β π₯)
The confidence interval is found by π§ z is the z-score of the area of
π π₯ βπ
1βπΆπΏ 2
where Similar to normal distribution but has fatter tails. Different sample size lead to slightly different shapes for t-distribution
Central Limit Theorem: A random sample of df: Degrees of Freedom = n-1 size n β₯ 30 is selected from an infinite (or large) population distributed with mean ΞΌ and π‘ = π₯βπ NEVER use Ο π π₯ /βπ standard deviation Ο. Let π₯ be the mean of this random sample; even if the parent population Confidence formula using t: π₯Μ
Β± π‘ π π₯ βπ is not normally distributed π₯ is approximately π₯βπ π₯βπ Sample Size Formulas (Always use z): normally distributed. (rare), π/βπ
π π₯ /βπ
(frequent) have the same distribution as z Binary Data: Suppose a very large dataset comprises only 1s and 0s
1.
πΈ= π§
π
Normal Distributions: Probability of one specific outcome of a continuous random variable z is 0%
π = π where p is the proportion of 1s
For point estimate: π₯Μ
Β± π§
2.
π π₯ βπ
βπ=(
π π₯ βπ
πππ π π¬
) always round up
For binary data: πΜ
Β± π§β
πΜ
(1βπΜ
) π
π = βπ(π β π) πΜ
(1βπΜ
)
ππΜ
(1βπΜ
)
For a sample of size n, π π₯ = β
πΈ = π§β
π
βπ=
Μ
(πβπ Μ
) ππ π π¬π
(round up)
πβ1
Use Cumulative Distribution Function (CDF) and Conservative sample size: If we donβt know πΜ
πΜ
βπ πΜ
βπ density function for a range of values Ex: π§ β Μ
(1βπΜ
) ππ
where πΜ
is the average π π(1βπ) use the worst case scenario of 0.5 and (1-0.5) β β CDF πΉ(π₯) = π(π§ < 1) πβ1 π of a sample of size n Μ(πβπ Μ) ππ π Density function = If there is πΜ, a prior estimate of p: π = π¬π derivative of CDF Hypothesis-Testing Procedure (keywords p-Value Hypothesis Testing: βsignificantβ, βstatistically significantβ): Shape of CDF is Same procedure as regular hypothesis Sigmoid Curve: 1. Form appropriate null and alternative hypotheses. H0 by convention has β₯, β€ or = testing except test statistic is the smaller Shape of density area under distribution. Find z/t/F/Ο2 score, whereas Ha has or β function is a bell 2. Determine the appropriate distribution (z, then look up area (this will be p-value) π₯2 1 β curve: π 2 t, Ο2 or F) 1. For a right/left tailed test reject π»0 if π < πΌ β2π 3. Calculate the appropriate test statistic 2. For a two tailed test, reject π»0 if 2π < πΌ Probabilities are found as areas under the 4. Using the level of significance Ξ± (by default density curve. First convert data to z-scores, 2-Sample Tests (used when comparing the 0.05) and tables of distribution to form then look up areas in table. means of two samples if n β₯30): rejection region. a. π»0 : π β€ π0 π»π : π > π0 Right tailed πΜ
βπΜ
For percentiles, use the table backwards, treat π§ = πΜ
(1βπΜ
1 ) πΜ
2 (1βπΜ
) (unless using a pooled test. Tail area = Ξ±. Reject H0 if test 1 1 + 2 2 β the percentile as an area then lookup the z π1 π2 statistic is > critical value from table score and convert to a data value proportion b. π»0 : π β₯ π0 π»π : π < π0 Left tailed test. Tail area = Ξ±. Reject H0 if test statistic is π§ = π₯Μ
1 βπ₯Μ
2 (except when using the pooled If a random sample of size n is drawn from a π 2 π 2 π₯βπ β 1 + 2 < critical value from table normal population, then has the same π1 π2 π/βπ c. π»0 : π β π0 π»π : π = π0 Two-tailed variance aka ANOVA) distribution as z. (π₯ is the mean of the sample) test. Tail areas = Ξ±/2. Reject H0 if test π π 2 π 2 statistic is > than right hand critical Standard error of sample mean: π₯ Standard error for π₯Μ
1 β π₯Μ
2 is β 1 + 2 βπ π1 π2 value or < than left hand critical value 5. State the conclusion in ordinary language For a t-distribution (n < 30): Estimation: The use of a single number calculated from a sample is called point estimation (statistic). Unfortunately, it is rarely equal to the parameter it is estimating An interval estimate has a margin of error. Confidence Level: estimate of the probability that the confidence interval includes the true parameter value
Studentβs t distribution: Theoretical Requirements: 1. Population should be approximately normally distributed 2. Sample should be randomly selected Useful for sample sizes n < 30
2 π 2 π 2
Satterthwaite DF: truncate result
T-statistic: π‘ =
π₯Μ
1 βπ₯Μ
2 π 2 π 2 β 1 + 1 π1
π2
( π1 + π2 ) 1 2
2 2 π 2 π 2 ( π1 ) ( π2 ) 1 2 + π1 β1 π2 β1
Multiple Regression πΜ = ππ + ππ ππ + β― + ππ ππ : Ο2 (Chi-square) distribution:
ANOVA: used for testing whether several means are statistically different
T statistic = Theoretical Requirements: 1. 2. 3.
π ππ is std error of ππ
Analysis of Variance for Regression:
The samples are taken from populations that are all normally distributed The samples are randomly and independently selected The variances of all the populations are roughly the same (homoscedasticity) 1
ππ π ππ
Source
DF
SS
MS
Regression
k
SSR
MSR
Error Total
n-k-1 n-1
SSE SSTOT
MSE
F πππ
πππΈ
R2 (coefficient of determination) =
πππ
πππππ
aka
proportion of the variation in y that is explained by the regression relationship. Most common measure of the accuracy a model
MSTR MSE
Compare to F distribution:
SSR (explained variation/regression sum of Numerator DF = number of treatments (k) β 1: squares) = R2 *SSTOT ππ·πΉ = π β 1 SSE (unexplained variation in y) = SSTOT-SSR Denominator DF = number of data points (n) β (β π¦)2 k: π·π·πΉ = π β π SSTOT (total variation in y) = (β π¦ 2 ) β π
ANOVA Table Method (preferred method): Source
DF
SS
MS
πππ
=
F ππππ
πππΈ
πππ
πππΈ =
π
π2 = β
(πβπΈ)2 πΈ
where O are observed A
Example contingency table:
Error Mean Square (MSE): β π π (the average k = number of x variables π of the square std deviations of the treatments) n = number of lines of data
ANOVA test statistic =
Chi-square independence test (keywords βindependentβ, βdependentβ, βdepends onβ, βrelated toβ
frequencies and E are expected frequencies
2
Treatment Mean Square (MSTR): ππ π(π₯Μ
π )2
π 2 β π§1 2 + π§2 2 + β― + π§3 2 (never negative)
πππΈ πβπβ1
A1 π΄1 π΅1 π π΄1 π΅2 π
A2 π΄2 π΅1 π π΄2 π΅2 π
B1 ALWAYS: B H0: A and B are B2 independent Ha: A and B are significantly dependent Example of Expected Frequencies: DF = (rows β 1)(columns β 1)
A B
A1 O11 O21
B1 B2
A2 O12 O22
If the test statistic > chi-square value in table, reject null hypothesis Chi-squared goodness of fit test:
If two sets of data are given, one of which is a set of expected values and another set which F and p-values are used for predicting whether a are observed values, use the Ο2 statistic. Never Error n-k SSE MSE model is significant for predicting y Total n-1 SSTOT use proportions for the frequencies. If H0: the model is not significant for predicting y proportions are given, multiply by the total Ha: the model is significant for predicting y SS: Sum of squares: number of data points to get the frequencies 2 (Treatment sum of squares) A change in R between two models can be H0: The expected values are not significantly (sum of treatment)2 (sum of all)2 determined by examining the p-value of the ππππ
= β β # of data in treatment total # of data different from the observed values removed variable. If p < Ξ±, change is significant Ha: The expected values are significantly (Error sum of squares) πππΈ = πππππ β ππππ
Marginal Contribution of a variable is its different from the observed values coefficient Power Test (probability that the null (Total sum squares) (sum of all)2 hypothesis will be correctly rejected): CI for marginal contribution: ππ Β± π‘ π ππ πππππ = (sum of all squares) β total # of data DF = Error DF Say we have Ο & n: MS: Mean square Prediction-Interval Formula (for simple H0: ΞΌ β€ a Ha: ΞΌ >a but ΞΌ actually = b ππππ
πππΈ regression): ππππ
= πππΈ = Treatments
πβ1
k-1
SSTR
MSTR
Standard error of estimate = βπππΈ
πβπ
H0: ΞΌ1 = ΞΌ2 = ΞΌ3 β¦ (not significantly different) Ha: at least one is significantly different
1
(π + ππ₯0 ) Β± π‘βπππΈ β1 + + π
(π₯0 βπ₯Μ
)2 (β π₯)2 (β π₯ 2 )β π
ANOVA Confidence Intervals (must be used if NOTE: ππ«π«π = βππ,π«π«π (if F NDF = 1) context of question is ANOVA):
Power of this test = π(π§ >
πβπ π ββπ
+ 1.645)
Type I error: If H0 is true, but an unlucky choice of sample makes the statistician reject H0
Type II error: If H0 is false, but an unlucky choice of sample makes the statistician not Standard error of simple regression coefficient Turn Ξ± into t value with DF being Error DF (n-k) reject H0 π. π₯Μ
π Β± π‘β
πππΈ ππ
πππΈ
π. π₯Μ
1 β π₯Μ
2 Β± π‘β
π1
+
πππΈ π2
π 0 = β
πππΈ (β π₯ 2 )β
(β π₯)2 π
Significance for Variance: If one variance is 4 times another, the variances are significantly different