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)?”

Slides:



Advertisements
Similar presentations
ASSUMPTION CHECKING In regression analysis with Stata
Advertisements

Introduction to R - Functions, Packages Andrew Jaffe 10/18/10.
Apr-15H.S.1 Stata: Linear Regression Stata 3, linear regression Hein Stigum Presentation, data and programs at: courses.
AMMBR - final stuff xtmixed (and xtreg) (checking for normality, random slopes)
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.
Statistical Techniques I EXST7005 Multiple Regression.
Stata and logit recap. Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with.
On a scale of 1-5 (5 being the best) rate yourself on your ability to complete all the assignments for class. Why? I rate my self a 5. I always get my.
Using SPSS. Handy buttons Switch between values & value labels Info about variables (& ‘Go To’)
Limitations of ANOVA ©2005 Dr. B. C. Paul. The Data Size Effect We Did ANOVA with one factor We Did ANOVA with one factor We Did it with two factors (Driver.
Xtreg and xtmixed: recap We have the standard regression model (here with only one x): but think that the data are clustered, and that the intercept (c.
Getting Started With STATA How do I do this? It probably opened automatically, but you may have to save it to the desktop, and double-click it to open.
Advanced Methods and Models in Behavioral Research – 2014 Been there / done that: Stata Logistic regression (……) Conjoint analysis Coming up: Multi-level.
Computing for Research I Spring 2011 Primary Instructor: Elizabeth Garrett-Mayer Stata Programming February 28.
AMMBR from xtreg to xtmixed (+checking for normality, and random slopes, and cross-classified models, and then we are done in terms of theory)
Computing for Research I Spring 2013 Primary Instructor: Elizabeth Garrett-Mayer Stata Programming February 21.
Talk Factory Primary Generic: instructions for use Supporting children‘s whole class discussions in primary school Copyright 2011 Open University.
The Basics of Regression continued
Multiple Imputation Stata (ice) How and when to use it.
Stata Introduction Sociology 229A, Class 2 Copyright © 2008 by Evan Schofer Do not copy or distribute without permission.
Finding help. Stata manuals You have all these as pdf! Check the folder /Stata12/docs.
Making a Book Report in Alice by Jenna Hayes Under the direction of Professor Susan Rodger Duke University, June 2010.
Project organisation in Stata Adrian Spoerri and Marcel Zwahlen Department of Social and Preventive Medicine University of Berne, Switzerland Research.
Introduction to Python
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.
How KeePass password safe can save you time and energy
Scottish Social Survey Network: Master Class 1 Data Analysis with Stata Dr Vernon Gayle and Dr Paul Lambert 23 rd January 2008, University of Stirling.
Introduction to R Part 2. Working Directory The working directory is where you are currently saving data in R. What is the current working directory?
DTIAtlasBuilder Adrien Kaiser Neuro Image Research and Analysis Laboratories University of North Carolina at Chapel Hill A tool to create an atlas from.
Advanced Methods and Models in Behavioral Research – 2010/2011 AMMBR course design CONTENT METHOD Y is 0/1 conjoint analysis logistic regression multi-level.
Key Data Management Tasks in Stata
Tricks in Stata Anke Huss Generating „automatic“ tables in a do-file.
Dealing with data All variables ok? / getting acquainted Base model Final model(s) Assumption checking on final model(s) Conclusion(s) / Inference Better.
Presented by the Virginia 4-H Science and Technology Committee PowerPoint 101.
Organizing a project, making a table Biostatistics 212 Lecture 7.
Organizing a project, making a table Biostatistics 212 Session 5.
Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6.
9-1 MGMG 522 : Session #9 Binary Regression (Ch. 13)
University of Warwick, Department of Sociology, 2014/15 SO 201: SSAASS (Surveys and Statistics) (Richard Lampard) Week 7 Logistic Regression I.
Advanced Stata Workshop FHSS Research Support Center.
Chapter 4: Introduction to Predictive Modeling: Regressions
Getting Started with Stata 2/11/2010 Tom Tomberlin Nealia Khan Learning Technologies Center Harvard Graduate School of Education.
STATA for S-052 M. Shane Tutwiler Your Friendly S-040 Lecturer William Johnston IT Services Harvard Graduate School of Education.
Generating Data for Assignment 9. Macro security policies Excel contains a programming language called Visual Basic for Applications that can be used.
Basics of Biostatistics for Health Research Session 1 – February 7 th, 2013 Dr. Scott Patten, Professor of Epidemiology Department of Community Health.
1 Econometrics (NA1031) Lecture 1 Introduction. 2 ”How much” type questions oBy how much a unit change in income affects consumption? oBy how much should.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Robust Regression. Regression Methods  We are going to look at three approaches to robust regression:  Regression with robust standard errors  Regression.
Brand Spanking New!. Facebook is constantly changing, reinventing itself Particularly in ways to monetize by encouraging business’s to advertise Always.
***Classification Model*** Hosam Al-Samarraie, PhD. CITM-USM.
Today Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation – GOF.
CS116 COMPILER ERRORS George Koutsogiannakis 1. How to work with compiler Errors The Compiler provide error messages to help you debug your code. The.
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Ec 2390: Section 1 Useful STATA commands Jack Willis September 14th, 2015.
Weekly Progress MAGGIE 16 th March Current Tasks Last week I was working on the following tasks Last week I was working on the following tasks –Logarithmic.
Introduction to Scratch We will be using the Scratch Environment today, so please log in to the Scratch website (scratch.mit.edu)
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
Getting started with Stata
Getting Started with R.
QM222 Class 13 Section D1 Omitted variable bias (Chapter 13.)
QM222 Class 16 & 17 Today’s New topic: Estimating nonlinear relationships QM222 Fall 2017 Section A1.
QM222 Class 8 Section A1 Using categorical data in regression
A statistical package for epidemiologists
Migration and the Labour Market
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Ordinary Least Square estimator using STATA
Presentation transcript:

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)?”

Using dummies with interval variables can help improve fit -Create two extra dummies: one for here and one for here -Or (typically when you have a lot of data points): create dummies per group

Variables need not be normally distributed … but it is often nice if they are (and gladder price will give you a graphical representation as well)

interact.ado A command to generate interaction effects Centralizes automatically for interval variables (and that’s important) interact var1 var2, gen(var1_X_var2) Installation: + Download diagfiles.zip online + Put files in some folder + Add that folder to adopath (adopath + “/folderpath”) (+ Add this adopath statement to “profile.do”)

Interpreting interactions: when you have interactions, “there are no main effects any more”

Potential transformations - fracpoly … and there are several options, for instance to decide on the space of searched transformations

fracplot shows the estimated shape

Finding outliers - diag2.ado (but only possible after regress, and you have to keep thinking yourself!)

The better way to find outliers in logit: ldfbeta (“findit ldfbeta”)

Note: Actually not completely Correct. Better (but more tedious), is to standardize the X-variables first.

Other possibilities … Try to find a subset of your data for which your model works better / differently (typically easier when you know something about the topic substantially) Consider sequences of models, instead of focusing on “the best model”: 

Sequences of models (easiest when you do not have that many variables)

Handy bits of coding global VARS var1 var2 var3 … reg y $VARS forvalues i = 1/10 { gen var`i’ = (varindata == `i’) }

Granddad talking: More buttons get rid of determination …

squeeze, but be honest

To Do Back to your logistic regression assignment. Compare what others have done with the dataset that you had. Improve, squeeze, and deliver one assignment (make that a do-file) per data set