1. 1. Population and Sampling Distributions
    1. Distribution test
  2. 2. Bivariate Regression Analysis
    1. Quantile-Normal Plot
      1. car::qqPlot( )
      2. car::scatterplot( )
      3. shapiro.test( )
    2. Box-Cox Transformation
      1. car::powerTransform( )
      2. car::bcPower( )
        1. Gamma for negative values
        2. Lambda for all transformation
      3. symbox( )
    3. Confidence interval
      1. Regression Line
      2. Points
  3. 3. Multiple Regression Analysis
    1. car::scatterplotMatrix( )
    2. Conditional Effect Plots
      1. effects:: allEffects ( )
      2. plot(Effect( ))
    3. Beta Coefficients
      1. coefplot ::coefplot( )
    4. Stepwise Regression
      1. MASS:: StepAIC( )
    5. Factoer Analysis
      1. scatterplot( y~x1 | x2 )
  4. 4. Instrumental Variable Regression
    1. AER::ivreg( original model | instrumental variable + exogenous )
    2. summary(ivreg, diagnostics=T)
    3. Sargan test
      1. n * R square, n means n observations
        1. n <- nobs ( model )
      2. 1-pchisq( )
  5. 5. Regression Diagnostics
    1. Multicollinearity
      1. vif( )
    2. Partial effects plots
      1. avPlots(lm)
    3. Residual plots (Tukey test)
      1. residualPlots(lm)
    4. student.resid
      1. rstudent(lm)
    5. DFBeta
      1. dfbetas(lm)
    6. Cook distance
      1. cooks.distance(lm)
    7. Leverage Plot
      1. Leverage Plot
    8. Diagnostics Plot Bonferroni p-values
      1. car::influenceIndexPlot(lm)
    9. Then use boxplot
  6. 6. Spatial Autocorrelation & Heteroscedasticity
    1. Heteroscedasticity
      1. car::ncvTest(lmBase, var.formula=~log(pop), data=Bladder)
      2. lmUpdated <- update(lmBase, weights=1/exp(predLogSigma2))
      3. lmHetero( )
      4. weighted.residuals( )
    2. Spatial Autocorrelation
      1. mapColorQual(prov.shp$REGION, prov.shp, map.title="Italy's Regions", legend.title="Region", add.to.map=T)
      2. Link matrix
        1. poly2nb(prov.shp, queen=F)
      3. row-sum standardized neighbors
        1. prov.linkW <- nb2listw(prov.link, style="W")
      4. Test with W-coding scheme
        1. lm.morantest(fert.wlm, prov.linkW)
      5. moran.plot(weighted.residuals(fert.wlm),prov.linkW, labels=prov.shp$PROVNAME)
    3. Spatial autoregressive model (SAR)
      1. spautolm( )
  7. 7. Logistic Regression Analysis
    1. Normal Logistic
      1. glm(y~x,family=binomial(logit))
      2. glm(y~x,family=binomial(probit))
      3. confint(GLM.01, level=0.95, type="Wald",trace = FALSE)
        1. Find the confidence interval of regression coefficients
    2. Effects Plot
      1. effects::plot(allEffects(GLM.03), type="response", ylim=c(0,1), ask=FALSE)
      2. Low & High Prob
        1. eff.GLM.low <- effect("lived",GLM.03, given.values=c(educ=20,"contamyes"=0,"hscyes"=0,"nodadyes"=1))
    3. Residual Exploration
      1. resid.GLM.03 <- residuals(GLM.03, type="response")
      2. pred.GLM.03 <- predict(GLM.03, type="response")
  8. 8. The Generalized Linear Model
    1. Overcome dispersion
    2. Normal Possion
    3. Likelihood Ratio Test
      1. Logistic Regression
        1. LR<- -2 *(logLik(log2) - logLik(log1))
        2. anova(log2, log1, test = "LRT")