STAT7055 Cheat Sheet
STAT7055 Cheat Sheet
1 n s XY 1 n
Sample s XY (Xi X )(Yi Y ) rXY X Xi
n 1i 1 s X sY n i 1
Week 2 Probability
Week 3 & Week 4 Random Variables and Discrete / Continuous Probability Distribution
Discrete Continuous
b Probability
P( X x) p ( x) Probability Distribution Table P(a X b) f ( x)dx Distribution Function
a
Properties
0 p( x) 1 x x1 & xn f ( x) 0, for all x
p( x) 1 p( x) p ( x1 ) & p( xn )
all x f ( x)dx 1
E( X ) ( x p( x)) E( X ) xf ( x)dx
Expected all x
Value
E ( g ( X )) ( g ( x) p( x)) E ( g ( X )) g ( x) f ( x)dx
all x
Variance
2
V (X ) E (( X )2 ) (( x )2 p( x)) 2
V (X ) E(( X )2 ) ( x )2 f ( x)dx
all x
P( X x, Y y) p ( x, y ) P{( X , Y ) A} f ( x, y)dxdy
Bivariate A
Distribution p( x) P( X x) p ( x, y ) Marginal Probability
all y f X ( x) f ( x, y)dy Marginal PDF
Cov( X , Y ) E (( X X )(Y Y ))
XY
V ( X ) E ( X 2 ) ( E ( X ))2
Covariance
(( x X )( y Y ) p( x, y )) Cov( X , Y ) E ( XY ) E ( X ) E (Y )
all x all y
Independence p( x, y) pX ( x) pY ( y)
Law of Expected Value Law of Variance
E (c) c E (cX ) cE ( X ) V (c) 0 V (cX ) c 2V ( X ) V ( X c) V ( X )
E ( X Y ) E ( X ) E (Y ) V ( X Y ) V ( X ) V (Y ) if X and Y are independent
E ( XY ) E ( X ) E (Y ) if X and Y are independent V (aX bY ) a 2V ( X ) b2V (Y ) 2abCov( X , Y )
a2 2
X b2 2
Y 2ab XY X Y
Binomial Distribution Uniform Distribution Normal Distribution
X Bin(n, p) 1 X
k k n k
a x b X N ( , 2
), Y N (0,1)
P( X k ) C p (1 p)
n
X U ( a, b) , f ( x) b a
( x )2
n! 0 others 1 2
p k (1 p)n k 2
f ( x) e 2 , x
k !(n k )! a b ( a b) 2
E( X ) , V (X )
E ( X ) np , V ( X ) np(1 p) 2 12 E( X ) , V (X ) 2
p P(Z z 2 ) P(Z z 2) p P( Z z ) p P( Z z )
Claim: 0 Claim: 0 Claim: 0 Claim: 0 Claim: 0
Setting
H0 : 0 H0 : 0 H0 : 0 H0 : 0 H0 : 0
Hypotheses
H1 : 0 H1 : 0H1 : H1 : 0 0 H1 : 0
Type I error Rejecting H0 when it is actually true. P(Type I error) significance level
Type II error Failing to reject H0 when it is actually not true. P(Type II error) 1 power of the test
62.6433 72 X 77.3567 72
P(Type II error) P(62.6433 X 77.3567 | H1 is true) P power of the test 1 0.1334
10 5 n 10 5
P 2.0922 Z 1.1978 P Z 1.20 P Z 2.09 0.8849 0.0183 0.8666
Chi-squared Goodness-of-fit Test 3 one categorical variable Chi-squared Test of a Contingency Table 3 used to determine
with k categories two categorical variables (with r and c categories) are independent
Hypotheses: Hypotheses:
H 0 : p1 c1 , p2 c2 , , pk ck H 0 : The variables are independent
H1: The population proportions do not match that given above H1: The variables are not independent
Test statistic: Test statistic: r : number of rows
k
fi ei
2 k : number of categories 2
c : number of columns
2 2
r c fij eij
f i : the observed counts f ij : the observed counts
i 1 ei i 1 j 1 eij
Rejection region:
ei : the expected counts ith row total jth column total
Rejection region: eij
2 2 ei pi n 2 2 sample size
,k 1 , r 1 c 1
lOMoARcPSD|26143093
Testing 1 2 ( 2
1 & 2
2 , known ) Testing 1 2 ( 2
1 & 2
2 , unknown ) Testing p1 p2
Hypotheses: Hypotheses: Hypotheses: Hypotheses:
H 0 : 1 2 D0 H0 : 2
1
2
2
H 0 : 1 2 D0 H 0 : p1 p2 D0
H1 : 1 2 ( , , ) D0 H1 : 2
1
2
2
H1 : 1 2 D0 H1 : p1 p2 D0
Test statistic: Test statistic: Test statistic: Test statistic:
( X1 X 2 ) D0 ( X 1 X 2 ) D0 * ( pÆ1 pÆ 2 ) D0
Z s12 T Z
2 2 F pÆ1 (1 pÆ1 ) pÆ 2 (1 pÆ 2 )
s22 1 1
1 2 s 2p n1 n2
n1 n2 n1 n2 ( pÆ1 pÆ 2 ) 0
Z if D0 0**
Rejection region: Rejection region: Rejection region: 1 1
pÆ (1 pÆ )
Z z 2 or Z z 2 (two-tailed ) F F 2 ,n1 1, n2 1
T t 2 , n1 n2 2 n1 n2
or F F1 or T t Rejection region:
Z z (upper-tailed >) 2 , n1 1, n2 1 2 , n1 n2 2
Z z 2 or Z z 2
Z z (lower-tailed <) 2
(n1 1) s (n2 1) s 2 X1 X 2 n1 pÆ1 n2 pÆ 2
* sp
2 1 2
pooled sample variance ** pÆ
n1 n2 2 n1 n2 n1 n2
2 2
1 1 pÆ1 (1 pÆ1 ) pÆ 2 (1 pÆ 2 )
Confidence
X1 X 2 z 1 2
X1 X 2 t s 2p ( ) pÆ1 pÆ 2 z
Interval 2
n1 n2 , n n2 2
2 1
n1 n2 2
n1 n2
Testing 1 2 with paired samples ÿ 1i 2i Di ÿas one sampleĀ
Hypotheses: Test statistic: Rejection region: Confidence interval:
H 0 : D D0 XD D0 sD
T T t or T t XD t
H1 : D
,n 1
D0 sD n 2,n 1 2,n 1 2
n
Yi 0 1 X 1i k X ki i
Estimating the model: Least Squared
Yi Æ ÆX ei ³ YÆi Æ ÆX Y = X³ + U
0 1 i 0 1 i
n
Y1 0 1 X 11 X k1 1
Æ s XY 1
E( Æ1 )
ei 2 Y2 1 X 12 Xk2
1 n 2i s Y ³ 1
X U 2
s X2 1 sÆ ( n 1) s X2
1
1 (n 1) s X2
n Yn 1 X 1n X kn
Æ ÆX E( Æ0 )
k n
X i2
0 Y 1 0 sÆ sÆ i 1 iid
2
iid
2
0 1
n Assumption: i N 0, / U N 0, I
Assessing the model 2
E (Y ) 0 1 X1 k Xk V (Y )
Hypotheses: Hypotheses:
³Æ
-1
H0: 1 0 H0: 0 Estimating the model XT X XT Y
H 1: 1 0 H 1: 0 Assessing the model (Overall & individual test)
Test statistic: Test statistic: Hypotheses:
Æ 0 Æ r n 2 H0: 1 2 k 0
1 1
T T
sÆ sÆ 1 r2 H1: Not all coefficient parameters are equal to zero
1 1