Dapr2 Equation Sheet
Dapr2 Equation Sheet
Calculating Coefficients
Intercept
𝛽0̂ = 𝑦 ̄ − 𝛽1̂ 𝑥̄
Slope
𝑆𝑃
𝛽1̂ = 𝑆𝑆𝑥𝑦
𝑥
Where 𝑆𝑃𝑥𝑦 = sum of cross-products:
𝑛
𝑆𝑃𝑥𝑦 = ∑𝑖=1 (𝑥𝑖 − 𝑥)(𝑦
̄ 𝑖 − 𝑦)̄
and 𝑆𝑆𝑥 = sums of squared deviations of 𝑥:
𝑛
𝑆𝑆𝑥 = ∑𝑖=1 (𝑥𝑖 − 𝑥)̄ 2
standardized coefficient
𝛽1∗̂ = 𝛽1̂ 𝑠𝑑
𝑠𝑑
𝑥
𝑦
SE( 𝛽1̂ )
𝑆𝐸(𝛽𝑗̂ ) = √ 𝑆𝑆 𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙 /(𝑛−𝑘−1)
∑(𝑥 −𝑥 ̄ )2 (1−𝑅2 )
𝑖𝑗 𝑗 𝑥𝑗
2
𝑅̂ 2 = 1 − (1−𝑅 )(𝑛−1)
𝑎𝑑𝑗𝑢𝑠𝑡𝑒𝑑 𝑛−𝑘−1
F
𝑀𝑆𝑀𝑜𝑑𝑒𝑙 𝑆𝑆𝑀𝑜𝑑𝑒𝑙 /𝑑𝑓𝑀𝑜𝑑𝑒𝑙
𝐹 (𝑑𝑓𝑚𝑜𝑑𝑒𝑙 , 𝑑𝑓𝑟𝑒𝑠𝑖𝑑𝑢𝑎𝑙 ) = 𝑀𝑆𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙 = 𝑆𝑆𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙 /𝑑𝑓𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙
Incremental F
(𝑆𝑆𝑅𝑅 −𝑆𝑆𝑅𝐹 )/(𝑑𝑓𝑅 −𝑑𝑓𝐹 )
𝐹(𝑑𝑓𝑅 −𝑑𝑓𝐹 ),𝑑𝑓𝐹 = 𝑆𝑆𝑅𝐹 /𝑑𝑓𝐹
Probing Interactions
Simple slopes
𝑦 ̂ = (𝛽1 + 𝛽3 𝑧)𝑥 + (𝛽2 𝑧 + 𝛽0 )
Locating a crossing point
𝑥1 = −𝛽
𝛽
2
𝑥2 = −𝛽1
𝛽3
3
Model Diagnostics
Partial residuals
𝜖𝑖 + 𝐵𝑗 𝑋𝑖𝑗
Hat values
(𝑥𝑖 −𝑥)̄ 2
ℎ𝑖 = 𝑛1 + 𝑛
∑𝑖=1 (𝑥𝑖 −𝑥)̄ 2
Cooks Distance 2
𝐷𝑖 = (StandardizedResidual
𝑘+1
𝑖)
× ℎ𝑖
1−ℎ𝑖
2
Where (StandardizedResidual
𝑘+1
𝑖)
= Outlyingness
ℎ𝑖
and 1−ℎ = Leverage
𝑖
So 𝐷𝑖 = Outlyingness × Leverage
Variance Inflation Factor
1
𝑉 𝐼𝐹𝑗 = 1−𝑅 2
𝑗
Multiple Comparisons
Family-wise Error Rate
𝑃 (Making a Type I error in m tests) = 1 − (1 − 𝛼)𝑚
Bonferroni & Sidak
𝛼
𝛼𝐵𝑜𝑛𝑓𝑒𝑟𝑟𝑜𝑛𝑖 = 𝑚 𝑝𝐵𝑜𝑛𝑓𝑒𝑟𝑟𝑜𝑛𝑖 = 𝑝 ∗ 𝑚
1
𝛼𝑆𝑖𝑑𝑎𝑘 = 1 − (1 − 𝛼) 𝑚
Scheffe
√𝑟𝐹 (𝛼; 𝑟; 𝑑)
Logistic regression
Probability, odds, log odds
Probability = 𝑃 (𝑌𝑖 )
𝑃 (𝑌 =1) 𝑃 (𝑌 =1)
odds = 1−𝑃 (𝑌 =1) logodds = 𝑙𝑛 ( 1−𝑃 (𝑌 =1) )
Deviance
𝑑𝑒𝑣𝑖𝑎𝑛𝑐𝑒 = −2 ∗ 𝑙𝑜𝑔𝑙𝑖𝑘𝑒𝑙𝑖ℎ𝑜𝑜𝑑
Testing logistic regression coefficients
𝑏
𝑧 = 𝑆𝐸(𝑏)