Transcription

2 Linear regression The command outreg2 gives you the type of presentation you see in academic papers. It is important to notice that outreg2 is not a Stata command, it is a user-written procedure, and you need to install it by typing (only the first time) ssc install outreg2 Follow this example (letters in italics you type) use "http://dss.princeton.edu/training/panel101.dta", clear reg y x1, robust outreg2 using myreg.doc, replace ctitle(model 1). outreg2 using myreg.doc, replace ctitle(model 1) myreg.doc Windows users click here to open the file myreg.doc in Word (you can replace this name with your own). Otherwise follow the Mac instructions. Mac users click here to go to the directory where myreg.doc is saved, open it with Word (you can replace this name with your own) You can add other model (using variable x2) by using the option append (NOTE: make sure to close myreg.doc) reg y x1 x2, robust outreg2 using myreg.doc, append ctitle(model 2). outreg2 using myreg.doc, append ctitle(model 2) myreg.doc You also have the option to export to Excel, just use the extension *.xls. For older versions of outreg2, you may need to specify the option word or excel (after comma) Source: Updated version shown here PU/DSS/

3 Linear regression: showing variable labels instead of variable names The command outreg2 gives you the type of presentation you see in academic papers. It is important to notice that outreg2 is not a Stata command, it is a user-written procedure, and you need to install it by typing (only the first time) ssc install outreg2 Follow this example (letters in italics you type) use "http://dss.princeton.edu/training/panel101.dta", clear reg y x1, robust outreg2 using myreg.doc, replace ctitle(model 1) label. outreg2 using myreg.doc, replace ctitle(model 1) myreg.doc Windows users click here to open the file myreg.doc in Word (you can replace this name with your own). Otherwise follow the Mac instructions. Mac users click here to go to the directory where myreg.doc is saved, open it with Word (you can replace this name with your own) You can add other model (using variable x2) by using the option append (NOTE: make sure to close myreg.doc) reg y x1 x2, robust outreg2 using myreg.doc, append ctitle(model 2) label. outreg2 using myreg.doc, append ctitle(model 2) myreg.doc You also have the option to export to Excel, just use the extension *.xls. For older versions of outreg2, you may need to specify the option word or excel (after comma) NOTE: Other options for label: label(insert); label(proper); label(upper); label(lower) Source: Updated version of PU/DSS/

4 Fixed effects regression Letters in italics you type use "http://dss.princeton.edu/training/panel101.dta", clear xtreg y x1 x2 x3, fe robust outreg2 using myreg.doc, replace ctitle(fixed Effects) addtext(country FE, YES). outreg2 using myreg.doc, replace ctitle(fixed Effects) addtext(country FE, YES) myreg.doc Windows users click here to open the file myreg.doc in Word (you can replace this name with your own). Otherwise follow the Mac instructions. Mac users click here to go to the directory where myreg.doc is saved, open it with Word (you can replace this name with your own) You also have the option to export to Excel, just use the extension *.xls. For older versions of outreg2, you may need to specify the option word or excel (after comma) In fixed effects models you do not have to add the FE coefficients, you can just add a note indicating that the model includes fixed effects. This can be added from outreg2, see the option addtex() above. Fro more info on panel data regression see PU/DSS/

5 Fixed effects with time fixed effects Letters in italics you type use "http://dss.princeton.edu/training/panel101.dta", clear xtreg y x1 x2 x3 i.year, fe robust outreg2 using myreg.doc, replace ctitle(fixed Effects) keep(x1 x2 x3) addtext(country FE, YES, Year FE, YES). outreg2 using myreg.doc, replace ctitle(fixed Effects) addtext(country FE, YES) myreg.doc Windows users click here to open the file myreg.doc in Word (you can replace this name with your own). Otherwise follow the Mac instructions. Mac users click here to go to the directory where myreg.doc is saved, open it with Word (you can replace this name with your own) You also have the option to export to Excel, just use the extension *.xls. For older versions of outreg2, you may need to specify the option word or excel (after comma) In fixed effects models you do not have to add the FE coefficients, you can just add a note indicating that the model includes fixed effects. This can be added from outreg2, see the option addtex() above. Fro more info on panel data regression see PU/DSS/

7 Regression: publishing logit/probit output (outreg2) You can use outreg2 for almost any regression output (linear or no linear). In the case of logit models with odds ratios, you need to add the option eform, see below use "http://dss.princeton.edu/training/panel101.dta", clear logit y_bin x1 outreg2 using mymod.doc, replace ctitle(logit coeff). outreg2 using mymod.doc, replace ctitle(logit coeff) mymod.doc logit y_bin x1, or outreg2 using mymod.doc, append ctitle(odds ratio) eform. outreg2 using mymod.doc, append ctitle(odds ratio) eform mymod.doc Windows users click here to open the file mymod.doc in Word (you can replace this name with your own). Otherwise follow the Mac instructions. Mac users click here to go to the directory where mymod.doc is saved, open it with Word (you can replace this name with your own) For more details/options and examples type help outreg2 Source: PU/DSS/

9 Using outreg2 for summary statistics: all variables in dataset sysuse auto, clear outreg2 using x.doc, replace sum(log). outreg2 using x.doc, replace sum(log) Variable Obs Mean Std. Dev. Min Max price mpg rep headroom trunk weight length turn displacement gear_ratio foreign Following variable is string, not included: make x.doc Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) For more details/options and examples type help outreg2

10 Using outreg2 for summary statistics: selected variables sysuse auto, clear outreg2 using x.doc, replace sum(log) keep(price mpg turn). outreg2 using x.doc, replace sum(log) keep(price mpg turn) Variable Obs Mean Std. Dev. Min Max price mpg rep headroom trunk weight length turn displacement gear_ratio foreign Following variable is string, not included: make x.doc Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) For more details/options and examples type help outreg2

12 Using outreg2 for summary statistics: selected variables in dataset and detail statistics *NOTE: The option sum(detail) will give all the summary statistics shown below for the selected variables but it will show in the output window results for all the variables in the dataset. This is similar to typing summarize, detail sysuse auto, clear set more off outreg2 using x.doc, replace sum(detail) keep(price mpg turn) Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) For more details/options and examples type help outreg2

13 Using outreg2 for summary statistics: selected variables in dataset and selected detail statistics *NOTE: The option sum(detail) will give all the summary statistics shown below for the selected variables but it will show in the output window results for all the variables in the dataset. This is similar to typing summarize, detail * The option p50 gives the median sysuse auto, clear set more off outreg2 using x.doc, replace sum(detail) keep(price mpg turn) eqkeep(n mean p50) Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) For more details/options and examples type help outreg2

14 Using outreg2 for summary statistics: by group, selected variables in dataset and detail statistics *NOTE: You need to specify either keeping statistics (eqkeep) and droping variables (drop) or viceversa. You can t specify eqkeep() and keep() at the same time sysuse auto, clear set more off bysort foreign: outreg2 using x.doc, replace sum(log) eqkeep(n mean) drop(make rep78 headroom trunk weight length displacement gear_ratio) Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) For more details/options and examples type help outreg2

15 Using outreg2 for frequencies sysuse auto, clear outreg2 foreign using x.doc, replace cross Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) For more details on what are frequencies and how to interpret the table see: For more details/options and examples type help outreg2

16 Using outreg2 for crosstabs *Taken from outreg2 s help file. It can report only column percents. sysuse auto, clear egen mileage=cut(mpg), group(10) outreg2 mileage foreign using x.doc, replace cross Windows users click here to open the file x.doc in Word (you can replace this name with your own). Otherwise follow the Mac users click here to go to the directory where x.doc is saved, open it with Word (you can replace this name with your own) NOTE: If you add the option side (after cross) it will put all values in columns. For more details on what are crosstabs and how to interpret the table see: For more details/options and examples type help outreg2

Selecting a Sub-set of Cases in SPSS: The Select Cases Command When analyzing a data file in SPSS, all cases with valid values for the relevant variable(s) are used. If I opened the 1991 U.S. General Social

Power Editor Guide February 29, 2012 Why should I use Power Editor?...2 Get started in 5 easy steps...3 Power Editor buttons and features.................................... 4 Navigate within Power Editor....6

Uploading GEDCOM Files and Copying the Information into Family Tree All registered users of FamilySearch.org can upload GEDCOM files for inclusion in the Pedigree Resource File. If you have access to Family

Interaction effects between continuous variables (Optional) Richard Williams, University of Notre Dame, http://www.nd.edu/~rwilliam/ Last revised February 0, 05 This is a very brief overview of this somewhat

HOW TO: A Guide to Using Qualtrics Research Suite 2 How this ebook can Benefit You Welcome to Qualtrics Research Suite! We are committed to your success, and want you to get the most out of your experience

1 Base Arithmetic 1.1 Binary Numbers We normally work with numbers in base 10. In this section we consider numbers in base 2, often called binary numbers. In base 10 we use the digits 0, 1, 2, 3, 4, 5,

Aras Corporation 2005 Aras Corporation. All rights reserved Notice of Rights All rights reserved. Aras Corporation (Aras) owns this document. No part of this document may be reproduced or transmitted in

MODELLING IF THEN IF...THEN Function EXCEL 2007 Wherever you see this symbol, make sure you remember to save your work! IF.Then Function Some functions do not calculate values but instead do logical tests

How to check your exemptions Please follow our short step-by-step guide to find out how to check what exemptions you may be eligible to claim. Step Searching for the institution where you studied Enter

IBM SPSS Statistics Base 22 Note Before using this information and the product it supports, read the information in Notices on page 179. Product Information This edition applies to ersion 22, release 0,

Imported Files Turning Surfaces into Solids in SolidWorks Problem Many times when you import a customer s part or assembly and it opens as a part that has a ton of surfaces or it may open as a multi level

User Guide Version 5.1 Copyright 2010 Pearson Education, Inc. or its affiliate(s). All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic

How to Convert Outlook Email Folder Into a Single PDF Document An introduction to converting emails with AutoPortfolio plug-in for Adobe Acrobat Table of Contents What Software Do I Need?... 2 Converting

TS- 644 Janice Bloom Everything you wanted to know about MERGE but were afraid to ask So you have read the documentation in the SAS Language Reference for MERGE and it still does not make sense? Rest assured

Chapter 2 Getting Data into R In the following chapter we address entering data into R and organising it as scalars (single values), vectors, matrices, data frames, or lists. We also demonstrate importing

Who Sends the Most Text Messages? Written by: Anna Bargagliotti and Jeanie Gibson (for Project-SET) Loyola Marymount University and Hutchison School abargagl@lmu.edu, jgibson@hutchisonschool.org, www.project-set.com