Finding help. Stata manuals You have all these as pdf! Check the folder /Stata12/docs.

Slides:



Advertisements
Similar presentations
ASSUMPTION CHECKING In regression analysis with Stata
Advertisements

Week 13 November Three Mini-Lectures QMM 510 Fall 2014.
AMMBR - final stuff xtmixed (and xtreg) (checking for normality, random slopes)
STATA Introductory manual. QUIZ What are the main OLS assumptions? 1.On average right 2.Linear 3.Predicting variables and error term uncorrelated 4.No.
AMMBR from xtreg to xtmixed (+checking for normality, random slopes)
Toolkit + “show your skills” AMMBR from xtreg to xtmixed (+checking for normality, and random slopes, and cross-classified models, and then we are almost.
Irwin/McGraw-Hill © Andrew F. Siegel, 1997 and l Chapter 12 l Multiple Regression: Predicting One Factor from Several Others.
Prediction, Correlation, and Lack of Fit in Regression (§11. 4, 11
Advanced Methods and Models in Behavioral Research – 2014 Been there / done that: Stata Logistic regression (……) Conjoint analysis Coming up: Multi-level.
AMMBR from xtreg to xtmixed (+checking for normality, and random slopes, and cross-classified models, and then we are done in terms of theory)
Multiple Linear Regression Model
Feb 21, 2006Lecture 6Slide #1 Adjusted R 2, Residuals, and Review Adjusted R 2 Residual Analysis Stata Regression Output revisited –The Overall Model –Analyzing.
Statistics 350 Lecture 21. Today Last Day: Tests and partial R 2 Today: Multicollinearity.
Multivariate Data Analysis Chapter 4 – Multiple Regression.
January 6, morning session 1 Statistics Micro Mini Multiple Regression January 5-9, 2008 Beth Ayers.
Lecture 20 Simple linear regression (18.6, 18.9)
Statistical Analysis SC504/HS927 Spring Term 2008 Session 7: Week 23: 7 th March 2008 Complex independent variables and regression diagnostics.
Regression Diagnostics Checking Assumptions and Data.
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc. Chap 15-1 Chapter 15 Multiple Regression Model Building Basic Business Statistics 11 th Edition.
Stat 112: Lecture 9 Notes Homework 3: Due next Thursday
Regression Model Building Setting: Possibly a large set of predictor variables (including interactions). Goal: Fit a parsimonious model that explains variation.
Forecasting Revenue: An Example of Regression Model Building Setting: Possibly a large set of predictor variables used to predict future quarterly revenues.
Objectives of Multiple Regression
1 Least squares procedure Inference for least squares lines Simple Linear Regression.
Typical paper follow-ups Paper is wrong (in the sense of a real mistake) There is an alternative explanation for the analytical results. You test that.
MultiCollinearity. The Nature of the Problem OLS requires that the explanatory variables are independent of error term But they may not always be independent.
Forecasting Revenue: An Example of Regression Model Building Setting: Possibly a large set of predictor variables used to predict future quarterly revenues.
Advanced Methods and Models in Behavioral Research – 2010/2011 AMMBR course design CONTENT METHOD Y is 0/1 conjoint analysis logistic regression multi-level.
1 1 Slide © 2007 Thomson South-Western. All Rights Reserved Chapter 13 Multiple Regression n Multiple Regression Model n Least Squares Method n Multiple.
Dealing with data All variables ok? / getting acquainted Base model Final model(s) Assumption checking on final model(s) Conclusion(s) / Inference Better.
Other Regression Models Andy Wang CIS Computer Systems Performance Analysis.
2 Multicollinearity Presented by: Shahram Arsang Isfahan University of Medical Sciences April 2014.
Multiple Regression and Model Building Chapter 15 Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Anaregweek11 Regression diagnostics. Regression Diagnostics Partial regression plots Studentized deleted residuals Hat matrix diagonals Dffits, Cook’s.
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. A PowerPoint Presentation Package to Accompany Applied Statistics.
Dr. C. Ertuna1 Issues Regarding Regression Models (Lesson - 06/C)
Maths Study Centre CB Open 11am – 5pm Semester Weekdays
Week 5Slide #1 Adjusted R 2, Residuals, and Review Adjusted R 2 Residual Analysis Stata Regression Output revisited –The Overall Model –Analyzing Residuals.
REGRESSION DIAGNOSTICS Fall 2013 Dec 12/13. WHY REGRESSION DIAGNOSTICS? The validity of a regression model is based on a set of assumptions. Violation.
Assumption checking in “normal” multiple regression with Stata.
Multiple Regression INCM 9102 Quantitative Methods.
Multiple regression.
I271B QUANTITATIVE METHODS Regression and Diagnostics.
Advanced Methods and Models in Behavioral Research – 2009/2010 AMMBR course design CONTENT METHOD Y is 0/1 conjoint analysis logistic regression multi-level.
Applied Quantitative Analysis and Practices LECTURE#30 By Dr. Osman Sadiq Paracha.
B AD 6243: Applied Univariate Statistics Multiple Regression Professor Laku Chidambaram Price College of Business University of Oklahoma.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc. Chap 15-1 Chapter 15 Multiple Regression Model Building Basic Business Statistics 10 th Edition.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 14-1 Chapter 14 Multiple Regression Model Building Statistics for Managers.
More on regression Petter Mostad More on indicator variables If an independent variable is an indicator variable, cases where it is 1 will.
Multiple Linear Regression An introduction, some assumptions, and then model reduction 1.
Stata – be the master Stata. “After I have run my standard commands, what can I do to make my model better (and understand better what is going on)?”
Assumptions & Requirements.  Three Important Assumptions 1.The errors are normally distributed. 2.The errors have constant variance (i.e., they are homoscedastic)
Data Screening. What is it? Data screening is very important to make sure you’ve met all your assumptions, outliers, and error problems. Each type of.
Regression Analysis Part A Basic Linear Regression Analysis and Estimation of Parameters Read Chapters 3, 4 and 5 of Forecasting and Time Series, An Applied.
Chapter 12 REGRESSION DIAGNOSTICS AND CANONICAL CORRELATION.
Chapter 15 Multiple Regression Model Building
Kakhramon Yusupov June 15th, :30pm – 3:00pm Session 3
Regression Diagnostics
Multiple Regression.
Chapter 12: Regression Diagnostics
Fundamentals of regression analysis
Multiple Regression A curvilinear relationship between one variable and the values of two or more other independent variables. Y = intercept + (slope1.
Multiple Regression Models
Chapter 4, Regression Diagnostics Detection of Model Violation
Regression Diagnostics
Homoscedasticity/ Heteroscedasticity In Brief
Regression Forecasting and Model Building
Homoscedasticity/ Heteroscedasticity In Brief
Chapter 13 Additional Topics in Regression Analysis
Multicollinearity What does it mean? A high degree of correlation amongst the explanatory variables What are its consequences? It may be difficult to separate.
Presentation transcript:

Finding help

Stata manuals You have all these as pdf! Check the folder /Stata12/docs

ASSUMPTION CHECKING AND OTHER NUISANCES In regression analysis with Stata In logistic regression analysis with Stata NOTE: THIS WILL BE EASIER IN Stata THAN IT WAS IN SPSS

Assumption checking in “normal” multiple regression with Stata

5 Assumptions in regression analysis No multi-collinearity All relevant predictor variables included Homoscedasticity: all residuals are from a distribution with the same variance Linearity: the “true” model should be linear. Independent errors: having information about the value of a residual should not give you information about the value of other residuals Errors are distributed normally

6 FIRST THE ONE THAT LEADS TO NOTHING NEW IN STATA (NOTE: SLIDE TAKEN LITERALLY FROM MMBR) Independent errors: having information about the value of a residual should not give you information about the value of other residuals Detect: ask yourself whether it is likely that knowledge about one residual would tell you something about the value of another residual. Typical cases: -repeated measures -clustered observations (people within firms / pupils within schools) Consequences: as for heteroscedasticity Usually, your confidence intervals are estimated too small (think about why that is!). Cure: use multi-level analyses  part 2 of this course

The rest, in Stata: Example: the Stata “auto.dta” data set sysuse auto corr (correlation) vif (variance inflation factors) ovtest (omitted variable test) hettest (heterogeneity test) predict e, resid swilk(test for normality)

Finding the commands “help regress”  “regress postestimation” and you will find most of them (and more) there

9 Multi-collinearity A strong correlation between two or more of your predictor variables You don’t want it, because: 1.It is more difficult to get higher R’s 2.The importance of predictors can be difficult to establish (b-hats tend to go to zero) 3.The estimates for b-hats are unstable under slightly different regression attempts (“bouncing beta’s”) Detect: 1.Look at correlation matrix of predictor variables 2.calculate VIF-factors while running regression Cure: Delete variables so that multi-collinearity disappears, for instance by combining them into a single variable

10 Stata: calculating the correlation matrix (“corr” or “pwcorr”) and VIF statistics (“vif”)

11 Misspecification tests (replaces: all relevant predictor variables included) Also run “ovtest, rhs” here. Both tests should be non-significant. Note that there are two ways to interpret “all relevant predictor variables included”

12 Homoscedasticity: all residuals are from a distribution with the same variance Consequences: Heteroscedasticiy does not necessarily lead to biases in your estimated coefficients (b-hat), but it does lead to biases in the estimate of the width of the confidence interval, and the estimation procedure itself is not efficient.

Testing for heteroscedasticity in Stata Your residuals should have the same variance for all values of Y  hettest Your residuals should have the same variance for all values of X  hettest, rhs

14 Errors distributed normally Errors should be distributed normally (just the errors, not the variables themselves!) Detect: look at the residual plots, test for normality, or save residuals and test directly Consequences: rule of thumb: if n>600, no problem. Otherwise confidence intervals are wrong. Cure: try to fit a better model (or use more difficult ways of modeling instead - ask an expert).

First calculate the errors (after regress): predict e, resid Then test for normality swilk e Errors distributed normally

Assumption checking in multi-level multiple regression with Stata

In multi-level Test all that you would test for multiple regression – poor man’s test: do this using multiple regression! (e.g. “hettest”) Add: xttest0 (see last week) Add (extra): Test visually whether the normality assumption holds 

Note: extra material (= not on the exam, bonus points if you know how to use it) tab school, gen(sch_) reg y sch2 – sch28 gen coefs =. for num 2/28: replace coefs =_b[schX] if _n==X swilk coefs

Assumption checking in logistic regression with Stata Note: based on books/logistic/chapter3/statalog3.ht m

Assumptions in logistic regression Y is 0/1 Independence of errors (as in multiple regression) No cases where you have complete separation (Stata will try to remove these cases automatically) Linearity in the logit (comparable to “the true model should be linear” in multiple regression) – “specification error” No multi-collinearity (as in m.r.)

What will happen if you try logit y x1 x2 in this case?

This! Because all cases with x==1 lead to y==1, the weight of x should be +infinity. Stata therefore rightly disregards these cases. Do realize that, even though you do not see them in the regression, these are extremely important cases!

(checking for) multi-collinearity In regression, we had “vif” Here we need to download a command that a user-created: “collin” (try “findit collin” in Stata)

(checking for) specification error The equivalent for “ovtest” is the command “linktest”

(checking for) specification error – part 2

Further things to do: Check for useful transformations of variables, and interaction effects Check for outliers / influential cases: 1) using a plot of stdres (against n) and dbeta (against n) 2) using a plot of ldfbeta’s (against n) 3) using regress and diag (but don’t tell anyone that I suggested this)

Checking for outliers … check the file auto_outliers.do for this …

Try the taxi tipping data