-
1. Population and Sampling Distributions
- Density function
- Cumulative distribution function
-
Statistics of Sample
- Unbiased mean (1/n) and variance (1 / [n-1] )
-
Covariance
- Measure of the linear relationship between pairs of random variables
-
Distribution
-
Normal Distribution
- All mutually independent
- The π‘-distribution
- The πΉ-distribution
-
The π2-distribution
- The sums of squared independent standard normal distributed variables
-
2. Bivariate Regression Analysis
-
Box-Cox Transformation
- Causes for extreme observations
- Only work for observations larger than zero
-
LOESS Smoother
- A sliding window moves over the value range of X
- In each window a local regression line is estimated
- These local regression lines are βsplinedβ together
- Bivariate regression analysis cannot control for confounding effects
-
KEY ASSUMPTIONS OF REGRESSION ANALYSIS
- The disturbances are required to be normal i.i.d. (independently identically distributed)
- Residual is uncorrelated with predicted value and independent variables
- The regression line must go through the means
- Regression coefficients have their own distribution
-
Statistic Test
-
Two-sided test
-
T-test
- π»0: π½1 = 0 (no base line level)
- t = π½1 / standard error
- π»0: π½1 = C (has base line level with constant C)
- t = (π½1 -C) / standard error
-
F-test
- F = ESS / (K-1) / RSS / (n-K)
- better for multiple regression
- The p-value of the entire line model is calculated by this
-
One-sided test
-
π»0: π½1 β€ 0 against π»1: π½1 > 0
π»0: π½1 β₯ 0 against π»1: π½1 < 0
- P-value enlarge 2 times
-
Confidence Intervals
- If 0 in the confidence interval, we could not reject None hypothesis.
- Closer to the mean of x, higher accuracy of prediction.
- Much wider than the interval for the entire line since we only use the information around that point instead of the whole sample
-
Elasticity
- Transform the bivariate model into the log-log form, and the estimated regression coefficient is interpreted as a relative rate of change
- For π1 > 1, means π¦ changes relatively faster than π₯
- Bold: Basic Theory or definition
Red: Very important Topic
Blue: Important Topic
-
3. Multiple Regression Analysis
-
Additional variables always reduce the stochastic error in the dependent variable
- That's why R Square always go down when you add additional variables
-
Partial regression coefficients
- The set of estimated parameters may change as new variables are added to the model
- Partial Effects
-
Standardized Regression Coefficients
- Measures independent variable changes by one standard deviation, how many standard deviations does dependent variable change?
- The larger the absolute valueοΌthe more influence has the independent variable on the variation of the dependent variable.
- The intercept is always zero since the mean of standardized variables is always zero
-
Statistic Test
-
Global F-test
- Null hypothesis testing for all parameters (except intercept) equal to zero
- The global F-test as special case of the partial F-test
-
Partial F-test
-
This allows comparison across models.
- anova( )
- To test whether these independent variables add significantly to the model
-
Interaction effects
- Exogenous variables do not act independently on the dependent variable.
- Products of the independent variables lead to interaction effects.
- Interaction effects increase the risk of multicollinarity because the product shares common information from both parent variables
- Polynomial Analysis would produce this situation (quadratic term)
- Use conditional effect plots to see the influence of independent variables
-
Factor Analysis in Regression Analysis
- Indicator variables allow us to model different regression regimes simultaneously and to cope with model heterogeneity
- Each regime has its own intercept, slope or even both.
-
One-hot encoding
- There are as many dummy variables for a categorical variable as there are categorical levels
-
Dummy encoding
- Since one category is redundant from one-hot encoding, so this method drop one category to avoid multicollinear
-
4. Instrumental Variable Regression
-
Endogenous Variable
- If the independence assumption between π₯ and the disturbances π breaks down [πΆππ£(π₯, π§) β 0 ], the variable π₯ becomes an endogenous regressor
-
Instrumental Variable
- Not related to disturbances π
- Related to the endogenous variable
- Instrumental estimator becomes
π½πΌπ = πΆππ£ (y,z) β πΆππ£ (x,z)
-
Exogenous Variable
- Regular regressors that are uncorrelated with the disturbances
-
Statistic Test
-
Partial F-test
- Additional instrumental variables improve the model substantially or not
-
Modified Hausman test
- Test the exogeneity of endogenous variable
- π»0: endogenous variable is uncorrelated with the disturbances π
-
Sargan test
- Test for instrument ππΌπ validity
- π»0: π
square = 0. all instrument variables are exogenous.
-
5. Regression Diagnostics
-
Assumptions in Linear Regression
- Regressors X is uncorrelated with the modelβs disturbances
- Expectation of π equal to 0 in the population
-
HomoscedasticityοΌVar(π) = Constant
-
Heteroscedasticity
- Diagonal of the covariance matrix of the disturbance would no longer be constant
-
Autocorrelation
- off-diagonal elements would no longer be zero
- Independence among the disturbances (no spatial autocorrelation)
-
The disturbances are normal distributed
-
Instrumental Regression
- Disturbances are correlated with endogenous variables
-
Identifying and Overcoming Assumption Violations
-
Identifying
-
Perform bivariate scatterplots
- The pairwise relationships in scatterplots is more informative
- Deal with non-linearity
- Box-Cox transformation
- Quadratic terms
- Interaction terms
- X-X combinations
- potential multicollinearity
-
Box-plot
- investigate factors
-
Overcoming
-
Feasible General Least Squares estimator
- Accommodate heteroscedasticity
-
Remove outliers
- Non-normality: t and F-test become unreliable for small sample sizes
- Observations in heavy-tails (outliers) have a substantially stronger impact on the estimates
- Transformations to pull outlying observations in
-
Influential combinations of Y-X
-
Standardize residuals &
Studentized residuals
- The confidence interval around a regression line gets wider as we move away from the center
- For Standardize residuals, their exact distribution is unknown (not normal distribution any more)
-
For studentized residuals, These residuals follow a t-distribution
- Outlying observations are best investigated using studentized residuals
-
Leverage
- Measures the distance of the i-th observations from the center
- Far distance may produce a larger impact on estimation
-
DFBETAS
- Underlying idea: re-estimated the regression coefficients with the i-th case deleted
- Larger score, higher impact
-
Cookβs Distance
- It measures the influence of the i-th case on the model as a whole rather than on individual partial regression coefficients.
-
Tukey Test
- The Tukey test evaluates whether by adding a squared term of an independent variable
- A π‘-test, that evaluates whether the quadratic term is significant
- The global Tukey test adds the squared predicted values to the model and performs a π‘-test, whether this term is significant
-
Multicollinearity
- Strong bivariate correlation among the independent variables is only a first indicator for multicollinearity
- The correlation among the estimated regression parameters is a better indicator
-
VIF (variance inflation factor)
- High inflation factor represents our data is highly redundancy
-
Autocorrelation
-
first order component
- The expected value of dependent variable, can be modeled with the use of exogenous information
-
second order component
- The covariance in the random error terms leads to a stochastic random process.
-
6. Spatial Autocorrelation
-
Maximum Likelihood
- Given the observed data {π₯1, β¦ , π₯π}, which is the most likely population parameter π that has generated the observations?
-
Requires
- The underlying distribution of each random variable is explicitly known and that the sample data match this distribution
- the observations are statistically independent (Could transfer auto-correlated observation to independent)
-
Transforming into logarithmic form
- Monotonically increasing
- Transfer Product to Summation
- Easy to find maximum (Derivatives of summations can skip the product rule)
-
Properties
- ML estimators are asymptotically unbiased
- The ML estimator is asymptotically consistent
- ML estimators are asymptotically normally distributed
- Comparable test statistics to the t-test, F-test and partial F-test can be calculated
-
Test
-
The Wald test
- Full model with all parameters is estimated
- a substitute for the single t-test (deviation over the standard error)
-
Likelihood Ratio Test (LR)
- Chi 2 = -2 * (ln(L[k-h]) - ln(L[k]) )) with h degrees of freedom
- Like partial F test
-
Heteroscedasticity
- no constant variance
-
For the simple model with just one weights variable π³1, that is
ππ2 = exp(πΎ0 β 1 + πΎ1 β ln(π§π1))
- πΎ1 > 0 : ππ2 is increasing with increasing π§π1
- πΎ1 β
0 : ππ2 is not affected by π§π1 β homoscedasticity
- πΎ1 < 0 : ππ2 is decreasing with increasing π§π1
-
A likelihood ratio test can be performed
- β2 β (logit(OLS model) β logit(weighted model)) ~ Chi distribution
with P-1 degree of freedom
-
Residual Spatial Autocorrelation Test
-
Spatial Link Matrix
- The spatial connectivity matrix operationalizes the underlying structure of the potential spatial relationships among the observations
-
Potential distance relationships
- Distance matrix
-
Potential neighborhood relationships
- Binary spatial connectivity matrix
- Row-sum standardized link matrix π / W
-
Reason of autocorrelation in regression residuals
-
Misspecification Rational
- Caused by unknown variable which has a spatial pattern
-
Spatial Process Rational
- The spatial object exhibit some spatial exchange relationships
- Interaction flows
- Competition effects
- Agglomerative advantages
-
Spatial Aggregation Rational
- If areal objects are split into parts and these split parts are merged with adjacent areal objects then these aggregated objects share parts of the information that they inherited from the split objects.
-
Moran's I
-
Standard deviate
- (Moran's I - Expectation) / sqrt(Variance) = Standard deviate
- The expectation and variance of Moran's πΌ dependent on the regression matrix X
- The observed value of Moran's πΌ depends on the exogenous variables π
-
Moranβs plot
- The observed residuals against the average values of their neighboring observations
- Residuals are best mapped by a bipolar map theme
-
Feasible general least square
-
Gaussian spatial processes
- Simultaneous autoregressive spatial process
- Conditional autoregressive spatial process
- Moving average spatial process
- Transfer dependent disturbance to independent and follow Gaussian distribution
-
7. Logistic Regression Analysis
-
The dependent variable is categorical
-
Observations could be both individual or grouped records
-
Individual Observations
- Two Categories (Binary distribution)
- Multiple Categories (Binary multinomial distribution)
-
Grouped Observations
- Two Categories (Binomial distribution)
- Multiple Categories (Multinomial distribution)
-
Basic logistic regression
- Focuses on individual observations, only two categories for dependent variables.
- The variance of the population disturbance is given by: Var (e) = (1 - u) * u
- The spread of the disturbances depends on the predicted value (probability), therefore, their variances become heteroscedastic
-
Solution to the heteroscedasticity
- Maximum
likelihood estimation
- Iteratively
re-weighted least squares
-
Why logistic regression
- The predicted value can only fall into the feasible range of probabilities [0,1]
-
8. The Generalized Linear Model
-
All based on exponential distribution family
- Normal
- Exponential
- Binomial
- Gamma
- Poisson
-
Potential reasons for observing excess dispersion
- This is a classic case of model misspecification.
- Observation are correlated with other counts
- An incorrect assumption about the distributional model
- The choice of the link function is incorrect.
- There are outliers in the data.
- Estimated regression coefficients remain unbiasedοΌ But their standard error comes
incorrect
-
The Offset Term
(baseline expectation)
- How the exogenous variables influence the variation of the individual expectations around their baseline expectations
- The regression coefficient of offset should be fixed ( usually set as 1 ), and offsets should be log-format.