Use data on individual respondents from the first 17 waves of the British Household

Size: px
Start display at page:

Download "Use data on individual respondents from the first 17 waves of the British Household"

Transcription

1 Applications of Data Analysis (EC969) Simonetta Longhi and Alita Nandi (ISER) Contact: slonghi and Week 1 Lecture 2: Data Management Use data on individual respondents from the first 17 waves of the British Household Panel Survey (BHPS). qindresp.dta The files are called aindresp.dta, bindresp.dta, 1. Merge files from the first two waves (aindresp.dta, and bindresp.dta) into wide format 2. Merge files from the first two waves (aindresp.dta, and bindresp.dta) into long format 3. Use loops to generalise the merging into long format to multiple waves 4. Declare the data to be a panel and compute transitions New Stata commands: - Combining waves: merge, append, renpfix - Inspecting the data: xtdes, xtsum - Panel data: tsset - Data manipulation: foreach, index(), bysort, L. - In-built Stata variable _N - Changing format from wide to long and from long to wide: reshape Merge Two Files into Wide Format Start your do file with the usual housekeeping (see the previous exercises). Upload the data for the second wave; sort the file for later matching on pid, save the file to be combined with wave 1, and type to reduce its size. use bhid pid bsex bmastat bage bqfachi blknbrd bpaygu /// using "$dirdata/bindresp", clear sort pid save bind_junk, replace The file is now ready to be merged with the file for the first wave. Repeat the same steps with the new file, and merge: use ahid pid asex amastat aage aqfachi alknbrd apaygu /// using "$dirdata/aindresp", clear sort pid merge 1:1 pid using bind_junk 1

2 There are different versions of the command merge, depending on the structure of the two files to be merged: One-to-one merge on specified key variables: merge 1:1 varlist using filename [, options] Many-to-one merge on specified key variables merge m:1 varlist using filename [, options] One-to-many merge on specified key variables merge 1:m varlist using filename [, options] Many-to-many merge on specified key variables merge m:m varlist using filename [, options] One-to-one merge by observation merge 1:1 _n using filename [, options] The merge command has generated a new variable. What is it? Look at the variable (tab _merge). It can assume three values: _merge == 1 these obs. were only in the master data (the file currently in memory, i.e. aindresp.dta) _merge == 2 these obs. were only in the using data (file being merged in, i.e. bind_junk.dta) _merge == 3 these obs. were in both master and using data (i.e. these people are in both waves) If we are interested in transitions across the two waves we can keep only those people present in both waves. How can we use this new variable for this purpose? Write the commands in your do file (and compare with the one at the end of this worksheet) Save the file after reducing its size. Remember to drop the variable _merge; a variable with the same name is created after each merge command. If another variable with the same name is already present, we would get an error message next time we want to combine files: tab _merge keep if _merge == 3 drop _merge save abind_wide, replace 2

3 Inspect the New Dataset and Compute Wage Changes Now describe the data to have a better look at the variables that are contained in the dataset; summarise the data to get information on means and sample sizes. Recode missing values in the variables apaygu and bpaygu Write the commands in your do file (and compare with the one at the end of this worksheet) Compute change in wages across the two waves; call the variable paych and label it. generate paych = bpaygu apaygu label var paych "Change in pay" How does the change in pay vary by sex? Save the file for later analyses. save abind_wide, replace Merge Two Files into Long Format Open wave 2 data file bindresp. Before being able to combine it with wave 1 we need some extra steps: 1. Generate a variable (wave) to identify which wave the observations are from. This is needed to distinguish between waves once the data are combined. 2. Rename all the variables by dropping the prefix b (there is no need to rename variable by variable, use the command renpfix instead). This is necessary so that each variable has the same name across waves and can be appended into a single column. (Note that this is not the case for all datasets. For example, in the German Socio-Economic Panel GSOEP the entire variable names, not only the prefixes, often change across waves.) use bhid pid bsex bmastat bage bqfachi blknbrd bpaygu /// using "$dirdata/bindresp", clear generate wave = 2 renpfix b 3

4 The command renpfix renames all the variables by dropping the prefix. For example, renpfix a would rename all the variables in the dataset whose name starts with a. Note that the command has no effect on the variable pid, since this does not have the wave prefix a : Original variable name (before renpfix a) ahid pid asex apaygu New variable name (after renpfix a) hid pid sex paygu Now save the file to be merged with wave 1. Repeat the same steps with the new file, before merging the two files. Write the commands in your do file (and compare with the one at the end of this worksheet) To combine the files into long format, use the command append. append using bind_junk Note that when there are variables with value labels, the labels retained are those of the master file. That is, the file that is in the working memory before appending, in this case aindresp. NB: In some cases labels vary across waves; consult Volume B of the BHPS user documentation for more information: We can now save the file after reducing its size: save abind_long, replace Inspect the New Dataset and Compute Wage Changes Again, describe the data to have a better look at the variables that are contained in the dataset; summarise the data to get information on means and sample sizes. Recode missing values in the variable paygu Write the commands in your do file (and compare with the one at the end of this worksheet) We can now declare the data to be a panel using the command tsset panelvar timevar. Where panelvar is the cross-wave identifier, in our case pid, while timevar is the time-series identifier, in our case the variable wave. The tsset 4

5 command tells Stata that the data has a panel structure, and allows us to use specific commands for time-series and panel data (e.g. all those starting with xt); it also allows proper treatment of gaps in panel and missing cases generally. tsset pid wave We can now describe (xtdes) and summarise (xtsum) the panel data. Compare different commands. What is the difference between describe and xtdes? What is the difference between sum and xtsum? NOTE: the command xtsum shows descriptive statistics for overall, between and within. The overall statistics refer to the whole sample; while the within statistics refer to each individual and to the variation from each individual s average (T-bar). If a variable does not change over time, its within standard deviation will be zero. The between statistics refer to individuals means and their variation. Now we can decide to keep only those present in both waves. The in-built Stata variable _N counts the number of observations in the bygroup. The command bysort repeats the Stata command on subsets of the data; in this case it repeats the command (_N) separately by pid. Hence, bysort pid: _N counts the number of observations with the same pid (here the maximum number is 2). Describe the data now: bysort pid: keep if _N == 2 xtdes xtsum Now we can compute changes in pay by using the operator L. which takes the lag of the variable following the dot. Hence, L.paygu means paygu t-1. If we want a twoperiods lag we can use L2.; there are also operators for computing leads (F.), first differences (D.) and seasonal differences (S.), which work in a similar way. Look at the Stata help for more details on the time series operators. gen paych = paygu L.paygu label var paych "Change in pay" How does the change in pay vary by sex? 5

6 Save the file for later analyses. save abind_long, replace Merge N Files into Long Format Generalisation to Multiple Waves The basic operations are the same as when we merge two waves. For each wave: Open the file; Rename all the variables by dropping the wave prefix; Generate a variable (wave) to identify the wave of this data; Save as a temporary file. To avoid rewriting the same commands for each wave, we can use loops: foreach wave in a b c d e f g h i j k l m n o p q { use `wave'hid pid `wave'sex `wave'mastat `wave'age /// `wave'qfachi `wave'paygu `wave'jbft /// `wave'region `wave'jbsoc `wave'jbbgy4 /// `wave'jbsemp `wave'jbstat /// `wave'cjsten /// using "$dirdata/`wave'indresp", clear renpfix `wave' // deal with wave p capture rename id pid gen wave = index("abcdefghijklmnopq","`wave'") save ind_junk`wave', replace } We want to repeat the series of commands for each of the 17 waves, each time substituting a different letter for `wave'. We use the command foreach to generate a loop which repeats the commands between {} for each element in the foreach list (a b... q). Note that the opening curly bracket must be on the same line as foreach; while the closing curly bracket must be in a line on its own. foreach creates a local macro, which you can name as you wish. We have called it `wave'. The content of the local macro is specified by the foreach list, which can be specified in different ways. In this specific case the list is a general one. Elements are separated from each other by one or more blanks: a b c d e f g h i j k l m n o p q. The contents of the local macro changes each time we go through the loop. The first time through, the content equals the first element in the foreach list (a). The second time through it contains the second element (b), and so on. To refer to the content of the local macro, we enclose its name in a left quote and apostrophe: `wave'. Note that pid never has a wave prefix. This generates a problem for wave p where renpfix would rename pid to id. If we simply specified rename id pid, we would get an error message which would terminate the execution of the do-file, for all waves in which Stata would not find a variable called id (i.e. all waves other than wave p). 6

7 Using capture tells Stata to swallow the error message and continue executing the do-file. Alternatively, we could use the command index("p","`wave'") to identify when the local variable `wave' has value p. The command identifies the position in the string p that is equal to the value in `wave'. Because the string is of only one character, the position will be 1. In this case the logical statement has value 1 when wave = p and 0 otherwise. When the return code is 1, we rename the variable id back to pid. Alternatively, we can reach the same result using an if statement: if "`wave'" == "p" rename id pid] We also use the index() function to generate the numerical variable identifying the wave: gen wave = index("abcdefghijklmnopq","`wave'"). The new variable wave will have value 1 when the local macro `wave' is equal to a; value 3 when it is equal to c, and so on. Note that some sets of questions are asked intermittently, hence, some variables might not be present in all waves. The easiest way to solve the problem consists in uploading the whole dataset (i.e. upload all variables), append the different waves, and then drop the variables you are not going to use for the analysis. Once the data for each wave have been extracted, prepared and saved, use a similar loop to append all waves. Note that the wave q file is still open. Append all other files to that: foreach wave in a b c d e f g h i j k l m n o p { append using ind_junk`wave'... } We should now recode all BHPS missing (i.e. all negative values) into Stata missing. We can either recode each variable separately, or use a similar version of the foreach loop: foreach var of varlist sex age region qfachi jbft jbstat /// paygu jbbgy4 jbsoc jbsemp mastat { recode `var' -9/-1 =. } Once again, we want to repeat the same commands for each variable in the foreach list. In this case the list contains the name of the variables for which we want to repeat the same command (sex paygu mastat...). Note that in this case we have chosen to call the local macro var. Note the difference between the previous and the current loop. In the first case we type foreach wave in; in the second case we type foreach var of varlist. foreach.. in is a general list type, which can be used with a list of variables, numbers or other types of elements. The advantage of using a specified list type, in this case a variable list, is that we can use shorthand conventions. For example, we could type foreach var of var1 var10, and Stata would understand this as including all variables between the two, in the order in which they appear in the data 7

8 set. Alternatively, we could type foreach var of Var*, which would include all variables starting with the three letters Var. Similarly, we could use the command forvalues with shorthand conventions for numerical lists (see help forvalues). Inspect the data, sort the file and save it: sum describe sort pid wave save ind_long, replace The creation of the data set is now complete. Inspect the New Dataset Now we can declare the data to be a panel, and inspect it using the appropriate commands (xtdes, xtsum). Also try the commands: iis and tis. Write the commands in your do file (and compare with the one at the end of this worksheet) iis // Reminds you which is // the variable with the person identifier Tis // Reminds you which is the variable // with the wave/time identifier When merging data from two files, we kept only those respondents who were present in both waves (we used a balanced panel). Here we could do the same: bysort pid: keep if _N == 17. However, in this case only a small proportion of people would remain in the dataset, and these are likely to be a selected sample. Every year there are new entrants in the BHPS, plus there have been extension samples (e.g. additional households from Scotland and Wales in 1999, and from Northern Ireland in 2001). Every year people drop out of the survey for various reasons, a phenomenon called panel attrition. Hence, it is better to retain all observations and select cases at the analysis stage (the variable creation commands usually are ok since transition variables are set to missing if a person is not present in at least one of the two consecutive waves). Compute Changes in Marital Status, and Wage Changes Inspect the variables mastat: a small number of cases are aged < 16 (code 0) and need to be excluded. For simplicity, also recode marital status into smaller number of categories (married, living as a couple or civil partnership = 1; widowed, divorced or separated = 2; never married = 3), generating the new variable ma. 8

9 Write the commands in your do file (and compare with the one at the end of this worksheet) Now generate a new variable which summarizes different transitions across marital statuses (below we call this variable mach) by creating a 2-digit summary of marital change. gen mach = (10*ma) + L.ma tab mach gen mach = (10*ma) + L.ma is a useful trick that we often use when we want to concatenate two numeric variables. Attach a short description to the variable using the command label var, then make the variable more accessible by labelling its values using the command label value label var mach "marital change" label define machlab 11 "stayed in couple" /// 12 "partnership ended" /// 13 "partnered -> never married" /// 21 "ex-partner -> partnership" /// 22 "stayed ex-partner" /// 23 "ex-partner -> never married" /// 31 "never married -> partnership" /// 32 "never married -> ex-partner" /// 33 "stayed never married" label value mach machlab tab mach list mach in 1/20, sepby(ahid) Note the difference between labelling a variable: label var mach "marital change" and labelling its values, after having defined the labels of each value: label define machlab 11 "stayed in couple" label value mach machlab We can now analyse transitions using the command xttrans. How does marriage vary over time and by sex? Now generate the variable paych, which measures the change in a person s earnings from one wave to the next. How does the change in pay vary by sex? 9

10 How does the change in pay vary over time by type of marital change and sex? 10

11 OPTIONAL From Wide to Long Format, and from Long to Wide Format Usually it is best to derive the data set in the format we need it in, but it is possible to convert files between long and wide format. For this part of the exercise we go back to the two files including only waves a and b. We can convert from long to wide format and vice versa by using the command reshape. Open the long file abind_long you saved previously, and reshape it into side format: use abind_long, clear reshape wide hid lknbrd sex mastat age qfachi paygu paych, /// i(pid) j(wave) sum save abind_converted, replace What happens to those variables with missing values in one wave? Convert from wide to long format by using a slightly different version of the command reshape. (Open the file in wide format if not already open) use abind_wide, clear capture noisily reshape long hid sex pagyu mastat lknbrd /// ma mach paych, i(pid) j(wave) The command is not successful (capture prevents the program from stopping; noisily requests that the error message which would otherwise be swallowed by capture be displayed). In this specific case reshaping does not work because the identifiers of waves are letters rather than numbers. To make the reshape command work we would need to first rename all the variables, e.g. ahid hid1; bhid hid2 Alternatively, try converting the file abind_converted from wide back to long format. Write the commands in your do file (and compare with the one at the end of this worksheet) Clean up delete temporary file no longer needed and close the log file, and close the log file: clear erase bind_junk.dta erase abind_long.dta erase abind_converted.dta log close 11

12 Do File version 11 clear all set more off capture log close set memory 20m global dir1 "\\iserhome\conferencedata\final" global dirresults "M:" log using "$dirresults\exercise2.log", replace ******************************************************************* * Merge files from the first two waves (aindresp.dta, bindresp.dta) * into wide format ******************************************************************* * Prepare file for wave 2 use bhid pid bsex bmastat bage bqfachi blknbrd bpaygu /// using "$dirdata\bindresp", clear sort pid save "$dirresults\bind_junk", replace * Merge with file for wave 1 use ahid pid asex amastat aage aqfachi alknbrd apaygu /// using "$dirdata\aindresp", clear sort pid merge 1:1 pid using "$dirresults\bind_junk" tab _merge * If we are interested in transitions, keep only those present * in both waves keep if _merge == 3 drop _merge * Need to drop the "_merge" variable because a variable * with the same name is created after each 'merge' command save "$dirresults\abind_wide", replace * Describe the data describe sum * Recode missing values and compute wage changes sum apaygu bpaygu recode apaygu -9/-1 =. recode bpaygu -9/-1 =. generate paych = bpaygu - apaygu label var paych "Change in pay" sum paych * How does the change in pay vary by sex? tab asex, sum(paych) 12

13 save "$dirresults\abind_wide", replace ******************************************************************* * Merge files from the first two waves (aindresp.dta, bindresp.dta) * into long format ******************************************************************* use bhid pid bsex bmastat bage bqfachi blknbrd bpaygu /// using "$dirdata\bindresp", clear generate wave = 2 renpfix b save "$dirresults\bind_junk", replace use ahid pid asex amastat aage aqfachi alknbrd apaygu /// using "$dirdata\aindresp", clear generate wave = 1 renpfix a append using "$dirresults\bind_junk" save "$dirresults\abind_long", replace * Describe the data describe sum * Recode missing values and compute wage changes sum paygu recode paygu -9/-1 =. * Declare the data to be panel tsset pid wave describe xtdes sum xtsum * Compute wage changes gen paych = paygu - L.paygu label var paych "Change in pay" * How does the change in pay vary by sex? tab sex, sum(paych) * Analysis results should be the same as for WIDE case save "$dirresults\abind_long", replace ******************************************************************* * Merge files into long format, generalisation to multiple waves ******************************************************************* foreach wave in a b c d e f g h i j k l m n o p q { use `wave'hid pid `wave'sex `wave'mastat `wave'age /// 13

14 `wave'qfachi `wave'paygu /// `wave'jbft `wave'region `wave'jbsoc `wave'jbbgy4 /// `wave'jbsemp `wave'jbstat `wave'cjsten /// using "$dirdata/`wave'indresp", clear // note that pid does not have the `wave' prefix renpfix `wave' // In wave "p" renpfix `wave' renames "pid" as "id" and a new variable called "id" is generated // Solution: rename the variable before the append. Alternatively combine id // and pid later if index("p","`wave'") rename id pid gen wave = index("abcdefghijklmnopq","`wave'") save "$dirresults\ind_junk`wave'", replace } foreach wave in a b c d e f g h i j k l m n o p { append using "$dirresults\ind_junk`wave'" } * Recode missing values foreach var of varlist sex age region qfachi jbft jbstat paygu /// jbbgy4 jbsoc jbsemp mastat { recode `var' -9/-1 =. } sum describe sort pid wave save "$dirresults\finalfile", replace tsset pid wave xtsum xtdes iis * Reminds you which is the variable with the person identifier tis * Reminds you which is the variable with the wave/time identifier * Compute Changes in Marital Status, and Wage Changes * tab mastat recode mastat (0 98 =.) (1 2 7 = 1) (3/5 = 2) (6 = 3), gen(ma) gen mach = (10*ma) + L.ma tab mach label var mach "marital change" label define machlab 11 "stayed in couple" /// 12 "partnership ended" /// 13 "partnered -> never married" /// 21 "ex-partner -> partnership" /// 22 "stayed ex-partner" /// 23 "ex-partner -> never married" /// 31 "never married -> partnership" /// 32 "never married -> ex-partner" /// 33 "stayed never married" label value mach machlab 14

15 tab mach list mach in 1/20, sepby(hid) xttrans mach * change in pay * recode paygu -9/-1 =. gen paych = paygu - L.paygu label var paych "Change in pay" * How does the change in income vary by sex? tab sex, sum(paych) * Income change over time, by type of marital change and sex table mach sex, contents(mean paych n paych) format(%9.2f) **************************************** * From Wide to Long Format, and * from Long to Wide Format **************************************** * Converting from LONG to WIDE format use "$dirresults\abind_long", clear reshape wide hid lknbrd sex mastat age qfachi paygu paych, /// i(pid) j(wave) sum save "$dirresults\abind_converted", replace * Converting from WIDE to LONG format use "$dirresults\abind_wide", clear capture noisily reshape long hid sex pagyu mastat lknbrd /// ma mach paych, i(pid) j(wave) // This command does not work in this specific case // because the identifiers of waves are letters rather than numbers // Need to first rename the variables, // e.g. ahid --> hid1; bhid --> hid2 *... but we can reconvert the abind_converted file from * wide back into long format; use "$dirresults\abind_converted", clear reshape long hid sex paygu lknbrd mastat age qfachi paych, /// i(pid) j(wave) * Clean up: delete temporary file no longer needed ********************************************* clear erase "$dirresults\abind_converted.dta" erase "$dirresults\abind_long.dta" erase "$dirresults\abind_wide.dta" 15

16 erase "$dirresults\bind_junk.dta" foreach wave in a b c d e f g h i j k l m n o p q { erase "$dirresults\ind_junk`wave'.dta" } log close 16

EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT)

EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT) EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT) DESCRIPTION: This example shows how to combine the data on respondents from the first two waves of Understanding Society into

More information

EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT)

EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT) EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT) DESCRIPTION: This example shows how to combine the data on respondents from the first two waves of Understanding Society into

More information

EXAMPLE 2: INTRODUCTION TO SAS AND SOME NOTES ON HOUSEKEEPING PART II - MATCHING DATA FROM RESPONDENTS AT 2 WAVES INTO WIDE FORMAT

EXAMPLE 2: INTRODUCTION TO SAS AND SOME NOTES ON HOUSEKEEPING PART II - MATCHING DATA FROM RESPONDENTS AT 2 WAVES INTO WIDE FORMAT EXAMPLE 2: PART I - INTRODUCTION TO SAS AND SOME NOTES ON HOUSEKEEPING PART II - MATCHING DATA FROM RESPONDENTS AT 2 WAVES INTO WIDE FORMAT USING THESE WORKSHEETS For each of the worksheets you have a

More information

Ninth ARTNeT Capacity Building Workshop for Trade Research "Trade Flows and Trade Policy Analysis"

Ninth ARTNeT Capacity Building Workshop for Trade Research Trade Flows and Trade Policy Analysis Ninth ARTNeT Capacity Building Workshop for Trade Research "Trade Flows and Trade Policy Analysis" June 2013 Bangkok, Thailand Cosimo Beverelli and Rainer Lanz (World Trade Organization) 1 Introduction

More information

Stata SHP Data Management (Stata 12)

Stata SHP Data Management (Stata 12) Stata SHP Data Management (Stata 12) Ursina Kuhn and Oliver Lipps, FORS, Lausanne Version August 2013 Content Aim of this documentation... 2 1 Missing values in the SHP... 2 2 Merge files... 3 2.1 Illustration

More information

Empirical trade analysis

Empirical trade analysis Empirical trade analysis Introduction to Stata Cosimo Beverelli World Trade Organization Cosimo Beverelli Stata introduction Bangkok, 18-21 Dec 2017 1 / 23 Outline 1 Resources 2 How Stata looks like 3

More information

An Introduction to Stata Part II: Data Analysis

An Introduction to Stata Part II: Data Analysis An Introduction to Stata Part II: Data Analysis Kerry L. Papps 1. Overview Do-files Sorting a dataset Combining datasets Creating a dataset of means or medians etc. Weights Panel data capabilities Dummy

More information

EXAMPLE 10: PART I OFFICIAL GEOGRAPHICAL IDENTIFIERS IN THE UNDERSTANDING SOCIETY PART II LINKING MACRO-LEVEL DATA AT THE LSOA LEVEL

EXAMPLE 10: PART I OFFICIAL GEOGRAPHICAL IDENTIFIERS IN THE UNDERSTANDING SOCIETY PART II LINKING MACRO-LEVEL DATA AT THE LSOA LEVEL EXAMPLE 10: PART I OFFICIAL GEOGRAPHICAL IDENTIFIERS IN THE UNDERSTANDING SOCIETY PART II LINKING MACRO-LEVEL DATA AT THE LSOA LEVEL DESCRIPTION: The objective of this example is to illustrate how external

More information

Workshop for empirical trade analysis. December 2015 Bangkok, Thailand

Workshop for empirical trade analysis. December 2015 Bangkok, Thailand Workshop for empirical trade analysis December 2015 Bangkok, Thailand Cosimo Beverelli (WTO) Rainer Lanz (WTO) Content a. Resources b. Stata windows c. Organization of the Bangkok_Dec_2015\Stata folder

More information

Subject index. ASCII data, reading comma-separated fixed column multiple lines per observation

Subject index. ASCII data, reading comma-separated fixed column multiple lines per observation Subject index Symbols %fmt... 106 110 * abbreviation character... 374 377 * comment indicator...346 + combining strings... 124 125 - abbreviation character... 374 377.,.a,.b,...,.z missing values.. 130

More information

Data analysis using Stata , AMSE Master (M1), Spring semester

Data analysis using Stata , AMSE Master (M1), Spring semester Data analysis using Stata 2016-2017, AMSE Master (M1), Spring semester Notes Marc Sangnier Data analysis using Stata Virtually infinite number of tasks for data analysis. Almost infinite number of commands

More information

An Introduction to Stata Part I: Data Management

An Introduction to Stata Part I: Data Management An Introduction to Stata Part I: Data Management Kerry L. Papps 1. Overview These two classes aim to give you the necessary skills to get started using Stata for empirical research. The first class will

More information

Using Subroutines and Loops to Simplify Submissions Involving Several Datasets

Using Subroutines and Loops to Simplify Submissions Involving Several Datasets Using Subroutines and Loops to Simplify Submissions Involving Several Datasets Goal When doing comparative research, it is natural to want to run the same routine across several different countries or

More information

Introduction to Stata - Session 1

Introduction to Stata - Session 1 Introduction to Stata - Session 1 Simon, Hong based on Andrea Papini ECON 3150/4150, UiO January 15, 2018 1 / 33 Preparation Before we start Sit in teams of two Download the file auto.dta from the course

More information

A quick introduction to STATA

A quick introduction to STATA A quick introduction to STATA Data files and other resources for the course book Introduction to Econometrics by Stock and Watson is available on: http://wps.aw.com/aw_stock_ie_3/178/45691/11696965.cw/index.html

More information

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables Jennie Murack You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables How to conduct basic descriptive statistics

More information

Lecture 2: Advanced data manipulation

Lecture 2: Advanced data manipulation Introduction to Stata- A. Chevalier Content of Lecture 2: Lecture 2: Advanced data manipulation -creating data -using dates -merging and appending datasets - wide and long -collapse 1 A] Creating data

More information

GETTING DATA INTO THE PROGRAM

GETTING DATA INTO THE PROGRAM GETTING DATA INTO THE PROGRAM 1. Have a Stata dta dataset. Go to File then Open. OR Type use pathname in the command line. 2. Using a SAS or SPSS dataset. Use Stat Transfer. (Note: do not become dependent

More information

Getting Our Feet Wet with Stata SESSION TWO Fall, 2018

Getting Our Feet Wet with Stata SESSION TWO Fall, 2018 Getting Our Feet Wet with Stata SESSION TWO Fall, 2018 Instructor: Cathy Zimmer 962-0516, cathy_zimmer@unc.edu 1) REMINDER BRING FLASH DRIVES! 2) QUESTIONS ON EXERCISES? 3) WHAT IS Stata SYNTAX? a) A set

More information

Merging Files of Time-varying Covariates

Merging Files of Time-varying Covariates Merging Files of Time-varying Covariates Mark Lunt Arthritis Research UK Epidemiology Unit, University of Manchester, Stopford Building, Oxford Road, Manchester, M13 9PT, U.K. Abstract. This insert describes

More information

ICSSR Data Service. Stata: User Guide. Indian Council of Social Science Research. Indian Social Science Data Repository

ICSSR Data Service. Stata: User Guide. Indian Council of Social Science Research. Indian Social Science Data Repository http://www.icssrdataservice.in/ ICSSR Data Service Indian Social Science Data Repository Stata: User Guide Indian Council of Social Science Research ICSSR Data Service Contents: 1. Introduction 1 2. Opening

More information

Description Quick start Menu Syntax Options Remarks and examples Stored results Also see

Description Quick start Menu Syntax Options Remarks and examples Stored results Also see Title stata.com xtset Declare data to be panel data Description Quick start Menu Syntax Options Remarks and examples Stored results Also see Description xtset manages the panel settings of a dataset. You

More information

Introduction to STATA

Introduction to STATA Introduction to STATA Duah Dwomoh, MPhil School of Public Health, University of Ghana, Accra July 2016 International Workshop on Impact Evaluation of Population, Health and Nutrition Programs Learning

More information

Introduction to Stata - Session 2

Introduction to Stata - Session 2 Introduction to Stata - Session 2 Siv-Elisabeth Skjelbred ECON 3150/4150, UiO January 26, 2016 1 / 29 Before we start Download auto.dta, auto.csv from course home page and save to your stata course folder.

More information

Intermediate Stata. Jeremy Craig Green. 1 March /29/2011 1

Intermediate Stata. Jeremy Craig Green. 1 March /29/2011 1 Intermediate Stata Jeremy Craig Green 1 March 2011 3/29/2011 1 Advantages of Stata Ubiquitous in economics and political science Gaining popularity in health sciences Large library of add-on modules Version

More information

set mem 10m we can also decide to have the more separation line on the screen or not when the software displays results: set more on set more off

set mem 10m we can also decide to have the more separation line on the screen or not when the software displays results: set more on set more off Setting up Stata We are going to allocate 10 megabites to the dataset. You do not want to allocate to much memory to the dataset because the more memory you allocate to the dataset, the less memory will

More information

GETTING STARTED WITH STATA. Sébastien Fontenay ECON - IRES

GETTING STARTED WITH STATA. Sébastien Fontenay ECON - IRES GETTING STARTED WITH STATA Sébastien Fontenay ECON - IRES THE SOFTWARE Software developed in 1985 by StataCorp Functionalities Data management Statistical analysis Graphics Using Stata at UCL Computer

More information

OVERVIEW OF WINDOWS IN STATA

OVERVIEW OF WINDOWS IN STATA OBJECTIVES OF STATA This course is the series of statistical analysis using Stata. It is designed to acquire basic skill on Stata and produce a technical reports in the statistical views. After completion

More information

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA Learning objectives: Getting data ready for analysis: 1) Learn several methods of exploring the

More information

Introduction to gretl

Introduction to gretl Introduction to gretl Applied Economics Department of Economics Universidad Carlos III de Madrid Outline 1 What is gretl? 2 gretl Basics 3 Importing Data 4 Saving as gretl File 5 Running a Script 6 First

More information

Maximizing Statistical Interactions Part II: Database Issues Provided by: The Biostatistics Collaboration Center (BCC) at Northwestern University

Maximizing Statistical Interactions Part II: Database Issues Provided by: The Biostatistics Collaboration Center (BCC) at Northwestern University Maximizing Statistical Interactions Part II: Database Issues Provided by: The Biostatistics Collaboration Center (BCC) at Northwestern University While your data tables or spreadsheets may look good to

More information

WORKFLOW. Effective Data Management Strategies for Doing Research Well

WORKFLOW. Effective Data Management Strategies for Doing Research Well WORKFLOW Effective Data Management Strategies for Doing Research Well WHY? Why an explicit focus on workflow? WHAT? What are the steps and tasks in an effective workflow? HOW? How can we use Stata and

More information

Revision of Stata basics in STATA 11:

Revision of Stata basics in STATA 11: Revision of Stata basics in STATA 11: April, 2016 Dr. Selim Raihan Executive Director, SANEM Professor, Department of Economics, University of Dhaka Contents a) Resources b) Stata 11 Interface c) Datasets

More information

An Introduction to Stata Exercise 1

An Introduction to Stata Exercise 1 An Introduction to Stata Exercise 1 Anna Folke Larsen, September 2016 1 Table of Contents 1 Introduction... 1 2 Initial options... 3 3 Reading a data set from a spreadsheet... 5 4 Descriptive statistics...

More information

Chapter 6: Modifying and Combining Data Sets

Chapter 6: Modifying and Combining Data Sets Chapter 6: Modifying and Combining Data Sets The SET statement is a powerful statement in the DATA step. Its main use is to read in a previously created SAS data set which can be modified and saved as

More information

Data Management 2. 1 Introduction. 2 Do-files. 2.1 Ado-files and Do-files

Data Management 2. 1 Introduction. 2 Do-files. 2.1 Ado-files and Do-files University of California, Santa Cruz Department of Economics ECON 294A (Fall 2014)- Stata Lab Instructor: Manuel Barron 1 Data Management 2 1 Introduction Today we are going to introduce the use of do-files,

More information

SIDM3: Combining and restructuring datasets; creating summary data across repeated measures or across groups

SIDM3: Combining and restructuring datasets; creating summary data across repeated measures or across groups SIDM3: Combining and restructuring datasets; creating summary data across repeated measures or across groups You might find that your data is in a very different structure to that needed for analysis.

More information

Lecture 4: Programming

Lecture 4: Programming Introduction to Stata- A. chevalier Content of Lecture 4: -looping (while, foreach) -branching (if/else) -Example: the bootstrap - saving results Lecture 4: Programming 1 A] Looping First, make sure you

More information

Intro to Stata for Political Scientists

Intro to Stata for Political Scientists Intro to Stata for Political Scientists Andrew S. Rosenberg Junior PRISM Fellow Department of Political Science Workshop Description This is an Introduction to Stata I will assume little/no prior knowledge

More information

Preparing Data for Analysis in Stata

Preparing Data for Analysis in Stata Preparing Data for Analysis in Stata Before you can analyse your data, you need to get your data into an appropriate format, to enable Stata to work for you. To avoid rubbish results, you need to check

More information

Practical Sheets for BHPS Data Confrontation Workshop Essex Summer School

Practical Sheets for BHPS Data Confrontation Workshop Essex Summer School Practical Sheets for BHPS Data Confrontation Workshop Essex Summer School Brendan Halpin Dept of Sociology University of Limerick July 2006 Essex Summer School, July 2006 BHPS Practicals 1 1 Accessing

More information

Introduction to Stata Toy Program #1 Basic Descriptives

Introduction to Stata Toy Program #1 Basic Descriptives Introduction to Stata 2018-19 Toy Program #1 Basic Descriptives Summary The goal of this toy program is to get you in and out of a Stata session and, along the way, produce some descriptive statistics.

More information

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200;

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200; Randy s SAS hints, updated Feb 6, 2014 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, first version: March 8, 2013 ***************; 2. Don

More information

Opening a Data File in SPSS. Defining Variables in SPSS

Opening a Data File in SPSS. Defining Variables in SPSS Opening a Data File in SPSS To open an existing SPSS file: 1. Click File Open Data. Go to the appropriate directory and find the name of the appropriate file. SPSS defaults to opening SPSS data files with

More information

Creating a data file and entering data

Creating a data file and entering data 4 Creating a data file and entering data There are a number of stages in the process of setting up a data file and analysing the data. The flow chart shown on the next page outlines the main steps that

More information

PSID-Tools: An interface to the the Panel Study of Income Dynamics

PSID-Tools: An interface to the the Panel Study of Income Dynamics PSID-Tools: An interface to the the Panel Study of Income Dynamics Ulrich Kohler ulrich.kohler@uni-potsdam.de Methods for Empirical Social Research Faculty for Economics and Social Sciences University

More information

What is Stata? A programming language to do sta;s;cs Strongly influenced by economists Open source, sort of. An acceptable way to manage data

What is Stata? A programming language to do sta;s;cs Strongly influenced by economists Open source, sort of. An acceptable way to manage data Introduc)on to Stata Training Workshop on the Commitment to Equity Methodology CEQ Ins;tute, Asian Development Bank, and The Ministry of Finance Dili May-June, 2017 What is Stata? A programming language

More information

Cross-Sectional Analysis

Cross-Sectional Analysis STATA 13 - SAMPLE SESSION Cross-Sectional Analysis Short Course Training Materials Designing Policy Relevant Research and Data Processing and Analysis with STATA 13 for Windows* 1st Edition Margaret Beaver

More information

Longitudinal Linkage of Cross-Sectional NCDS Data Files Using SPSS

Longitudinal Linkage of Cross-Sectional NCDS Data Files Using SPSS Longitudinal Linkage of Cross-Sectional NCDS Data Files Using SPSS What are we doing when we merge data from two sweeps of the NCDS (i.e. data from different points in time)? We are adding new information

More information

Event study Deals Stock Prices Additional Financials

Event study Deals Stock Prices Additional Financials Event study Deals Stock Prices Additional Financials In this manual we will explain how to get data for the purpose of an event study. While we do describe the steps in the data collection process, we

More information

Splitting Spells Using Very Large or Daily Data Sets

Splitting Spells Using Very Large or Daily Data Sets Splitting Spells Using Very Large or Daily Data Sets The stata syntax files splitspells.do and combispells.do Klaudia Erhardt, German Institute for Economic Research (DIW), departement SOEP Ralf Künster,

More information

Data Management Using Stata: A Practical Handbook

Data Management Using Stata: A Practical Handbook Data Management Using Stata: A Practical Handbook MICHAEL N. MITCHELL A Stata Press Publication StataCorp LP College Station, Texas Copyright c 2010 by StataCorp LP All rights reserved. First edition 2010

More information

Quick Guide to American FactFinder

Quick Guide to American FactFinder Quick Guide to American FactFinder 1. Search Terms... 2 2. Finding Neighborhoods... 6 3. Downloading the Tables 13 4. Interpreting the Numbers... 18 Introduction The American FactFinder is a useful online

More information

A Short Guide to Stata 10 for Windows

A Short Guide to Stata 10 for Windows A Short Guide to Stata 10 for Windows 1. Introduction 2 2. The Stata Environment 2 3. Where to get help 2 4. Opening and Saving Data 3 5. Importing Data 4 6. Data Manipulation 5 7. Descriptive Statistics

More information

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS TO SAS NEED FOR SAS WHO USES SAS WHAT IS SAS? OVERVIEW OF BASE SAS SOFTWARE DATA MANAGEMENT FACILITY STRUCTURE OF SAS DATASET SAS PROGRAM PROGRAMMING LANGUAGE ELEMENTS OF THE SAS LANGUAGE RULES FOR SAS

More information

DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS

DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS Using SPSS Topics addressed today: 1. Accessing data from CMR 2. Starting SPSS 3. Getting familiar with SPSS 4. Entering data 5. Saving data

More information

Saving Time with Prudent Data Management. Basic Principles To Save Time. Introducing Our Data. Yearly Directed Dyads (Multiple Panel Data)

Saving Time with Prudent Data Management. Basic Principles To Save Time. Introducing Our Data. Yearly Directed Dyads (Multiple Panel Data) Saving Time with Prudent Data Management Brandon Bartels & Kevin Sweeney Program In Statistics and Methodology Outline Some Basic Principles Introducing the Data (Dyad-Years) Common Tasks Sorting Generating

More information

SPSS TRAINING SPSS VIEWS

SPSS TRAINING SPSS VIEWS SPSS TRAINING SPSS VIEWS Dataset Data file Data View o Full data set, structured same as excel (variable = column name, row = record) Variable View o Provides details for each variable (column in Data

More information

Chapter 17: INTERNATIONAL DATA PRODUCTS

Chapter 17: INTERNATIONAL DATA PRODUCTS Chapter 17: INTERNATIONAL DATA PRODUCTS After the data processing and data analysis, a series of data products were delivered to the OECD. These included public use data files and codebooks, compendia

More information

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT PRIMER FOR ACS OUTCOMES RESEARCH COURSE: TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT STEP 1: Install STATA statistical software. STEP 2: Read through this primer and complete the

More information

Title. Description. Quick start. stata.com. label Manipulate labels

Title. Description. Quick start. stata.com. label Manipulate labels Title stata.com label Manipulate labels Description Quick start Menu Syntax Options Remarks and examples Stored results References Also see Description label data attaches a label (up to 80 characters)

More information

A Short Introduction to STATA

A Short Introduction to STATA A Short Introduction to STATA 1) Introduction: This session serves to link everyone from theoretical equations to tangible results under the amazing promise of Stata! Stata is a statistical package that

More information

Introduction to Programming, Aug-Dec 2006

Introduction to Programming, Aug-Dec 2006 Introduction to Programming, Aug-Dec 2006 Lecture 3, Friday 11 Aug 2006 Lists... We can implicitly decompose a list into its head and tail by providing a pattern with two variables to denote the two components

More information

Dr. Barbara Morgan Quantitative Methods

Dr. Barbara Morgan Quantitative Methods Dr. Barbara Morgan Quantitative Methods 195.650 Basic Stata This is a brief guide to using the most basic operations in Stata. Stata also has an on-line tutorial. At the initial prompt type tutorial. In

More information

ECONOMICS 351* -- Stata 10 Tutorial 1. Stata 10 Tutorial 1

ECONOMICS 351* -- Stata 10 Tutorial 1. Stata 10 Tutorial 1 TOPIC: Getting Started with Stata Stata 10 Tutorial 1 DATA: auto1.raw and auto1.txt (two text-format data files) TASKS: Stata 10 Tutorial 1 is intended to introduce (or re-introduce) you to some of the

More information

I Launching and Exiting Stata. Stata will ask you if you would like to check for updates. Update now or later, your choice.

I Launching and Exiting Stata. Stata will ask you if you would like to check for updates. Update now or later, your choice. I Launching and Exiting Stata 1. Launching Stata Stata can be launched in either of two ways: 1) in the stata program, click on the stata application; or 2) double click on the short cut that you have

More information

PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2

PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2 PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2 Overview Most assignments will have a companion lab to help you learn the task and should cover similar

More information

INTRODUCTION to SAS STATISTICAL PACKAGE LAB 3

INTRODUCTION to SAS STATISTICAL PACKAGE LAB 3 Topics: Data step Subsetting Concatenation and Merging Reference: Little SAS Book - Chapter 5, Section 3.6 and 2.2 Online documentation Exercise I LAB EXERCISE The following is a lab exercise to give you

More information

Introduc)on to Stata. Training Workshop on the Commitment to Equity Methodology CEQ Ins;tute and The Ministry of Finance Accra February 7-10, 2017

Introduc)on to Stata. Training Workshop on the Commitment to Equity Methodology CEQ Ins;tute and The Ministry of Finance Accra February 7-10, 2017 Introduc)on to Stata Training Workshop on the Commitment to Equity Methodology CEQ Ins;tute and The Ministry of Finance Accra February 7-10, 2017 What is Stata? A programming language to do sta;s;cs Strongly

More information

A Quick Guide to Stata 8 for Windows

A Quick Guide to Stata 8 for Windows Université de Lausanne, HEC Applied Econometrics II Kurt Schmidheiny October 22, 2003 A Quick Guide to Stata 8 for Windows 2 1 Introduction A Quick Guide to Stata 8 for Windows This guide introduces the

More information

ADePT: Labor. Technical User s Guide. Version 1.0. Automated analysis of the labor market conditions in low- and middle-income countries

ADePT: Labor. Technical User s Guide. Version 1.0. Automated analysis of the labor market conditions in low- and middle-income countries Development Research Group, Development Economics, World Bank ADePT: Labor Version 1.0 Automated analysis of the labor market conditions in low- and middle-income countries Technical User s Guide The ADePT

More information

A Cross-national Comparison Using Stacked Data

A Cross-national Comparison Using Stacked Data A Cross-national Comparison Using Stacked Data Goal In this exercise, we combine household- and person-level files across countries to run a regression estimating the usual hours of the working-aged civilian

More information

TO SEE WHAT S NEW AND HOW TO INSTALL THE SOFTWARE OR UPDATES, GO TO PAGE

TO SEE WHAT S NEW AND HOW TO INSTALL THE SOFTWARE OR UPDATES, GO TO PAGE CS SUITE with Custom Domestic Forms 1 9 9 8-2 0 1 9 T H O M A S E. J A F F E S U I T E 4 5 5 0, 7 0 1 F I F T H A V E N U E S E A T T L E, W A S H I N G T O N 9 8 1 0 4 2 0 6. 6 2 4. 4 9 0 0 t e j @ i

More information

Business Data Analysis MA0123. Dr Gavin Shaddick Department of Mathematical Sciences 4W 5.7

Business Data Analysis MA0123. Dr Gavin Shaddick Department of Mathematical Sciences 4W 5.7 Business Data Analysis MA0123 Dr Gavin Shaddick Department of Mathematical Sciences g.shaddick@bath.ac.uk 4W 5.7 Lectures and computer labs Two lectures a week (Monday and Friday). One computing lab (time

More information

An Introduction to Stata

An Introduction to Stata An Introduction to Stata Instructions Statistics 111 - Probability and Statistical Inference Jul 3, 2013 Lab Objective To become familiar with the software package Stata. Lab Procedures Stata gives us

More information

STATA TUTORIAL B. Rabin with modifications by T. Marsh

STATA TUTORIAL B. Rabin with modifications by T. Marsh STATA TUTORIAL B. Rabin with modifications by T. Marsh 5.2.05 (content also from http://www.ats.ucla.edu/stat/spss/faq/compare_packages.htm) Why choose Stata? Stata has a wide array of pre-defined statistical

More information

2. Don t forget semicolons and RUN statements The two most common programming errors.

2. Don t forget semicolons and RUN statements The two most common programming errors. Randy s SAS hints March 7, 2013 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, March 8, 2013 ***************; 2. Don t forget semicolons and

More information

Using macros enables you to repeat tasks much

Using macros enables you to repeat tasks much An Introduction to Macros Using macros enables you to repeat tasks much more efficiently than tediously performing each step over and over. A macro is a set of instructions that you use to automate a task.

More information

25 Working with categorical data and factor variables

25 Working with categorical data and factor variables 25 Working with categorical data and factor variables Contents 25.1 Continuous, categorical, and indicator variables 25.1.1 Converting continuous variables to indicator variables 25.1.2 Converting continuous

More information

Community Resource: Egenmore, by command, return lists, and system variables. Beksahn Jang Feb 22 nd, 2016 SOC561

Community Resource: Egenmore, by command, return lists, and system variables. Beksahn Jang Feb 22 nd, 2016 SOC561 Community Resource: Egenmore, by command, return lists, and system variables. Beksahn Jang Feb 22 nd, 2016 SOC561 Egenmore Egenmore is a package in Stata that extends the capabilities of the egen command.

More information

A QUICK INTRODUCTION TO STATA

A QUICK INTRODUCTION TO STATA A QUICK INTRODUCTION TO STATA This module provides a quick introduction to STATA. After completing this module you will be able to input data, save data, transform data, create basic tables, create basic

More information

STATA Hand Out 1. STATA's latest version is version 12. Most commands in this hand-out work on all versions of STATA.

STATA Hand Out 1. STATA's latest version is version 12. Most commands in this hand-out work on all versions of STATA. STATA Hand Out 1 STATA Background: STATA is a Data Analysis and Statistical Software developed by the company STATA-CORP in 1985. It is widely used by researchers across different fields. STATA is popular

More information

Getting started with Stata 2017: Cheat-sheet

Getting started with Stata 2017: Cheat-sheet Getting started with Stata 2017: Cheat-sheet 4. september 2017 1 Get started Graphical user interface (GUI). Clickable. Simple. Commands. Allows for use of do-le. Easy to keep track. Command window: Write

More information

INTRODUCTORY SPSS. Dr Feroz Mahomed Swalaha x2689

INTRODUCTORY SPSS. Dr Feroz Mahomed Swalaha x2689 INTRODUCTORY SPSS Dr Feroz Mahomed Swalaha fswalaha@dut.ac.za x2689 1 Statistics (the systematic collection and display of numerical data) is the most abused area of numeracy. 97% of statistics are made

More information

using and Understanding Formats

using and Understanding Formats using and Understanding SAS@ Formats Howard Levine, DynaMark, Inc. Oblectives The purpose of this paper is to enable you to use SAS formats to perform the following tasks more effectively: Improving the

More information

STATA 10 for surveys manual. Part 1

STATA 10 for surveys manual. Part 1 STATA 10 for surveys manual Part 1 By Sandro Leidi 1, Roger Stern 1, Brigid McDermott 2 Savitri Abeyasekera 1, Andrew Palmer 1 1 Statistical Services Centre, University of Reading, U.K. 2 Biometrics Unit

More information

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata Paul Dickman September 2003 1 A brief introduction to Stata Starting the Stata program

More information

A quick introduction to STATA:

A quick introduction to STATA: 1 Revised September 2008 A quick introduction to STATA: (by E. Bernhardsen, with additions by H. Goldstein) 1. How to access STATA from the pc s at the computer lab After having logged in you have to log

More information

Stata basics (Stata 13 or 14)

Stata basics (Stata 13 or 14) Stata basics (Stata 13 or 14) Ursina Kuhn and Oliver Lipps, FORS, Lausanne Version August 2016 Content 1. Getting started...2 1.1 Stata Interface...2 1.2 Getting help...2 1.3 Command Syntax of Stata...2

More information

Object Oriented Design

Object Oriented Design Object Oriented Design Lecture 3: Introduction to C++ (Continue) Examples using declarations that eliminate the need to repeat the std:: prefix 1 Examples using namespace std; enables a program to use

More information

Description Quick start Menu Syntax Options Remarks and examples Stored results References Also see

Description Quick start Menu Syntax Options Remarks and examples Stored results References Also see Title stata.com tsset Declare data to be time-series data Description Quick start Menu Syntax Options Remarks and examples Stored results References Also see Description tsset manages the time-series settings

More information

WORKSHOP: Using the Health Survey for England, 2014

WORKSHOP: Using the Health Survey for England, 2014 WORKSHOP: Using the Health Survey for England, 2014 There are three sections to this workshop, each with a separate worksheet. The worksheets are designed to be accessible to those who have no prior experience

More information

Sustainability of Public Policy Lecture 1 Introduc6on STATA. Rossella Iraci Capuccinello

Sustainability of Public Policy Lecture 1 Introduc6on STATA. Rossella Iraci Capuccinello Sustainability of Public Policy Lecture 1 Introduc6on STATA Rossella Iraci Capuccinello Ge=ng started in STATA! Start STATA " Simply click on icon " Stata should look like this: BuDons/menu Review window

More information

Contents Append Merge Further Exercises... 24

Contents Append Merge Further Exercises... 24 Contents 1 Essentials of the Stata Language 3 1.1 Introduction....................................... 3 1.2 Getting Help...................................... 3 1.2.1 Help.......................................

More information

Introduction to Stata. Getting Started. This is the simple command syntax in Stata and more conditions can be added as shown in the examples.

Introduction to Stata. Getting Started. This is the simple command syntax in Stata and more conditions can be added as shown in the examples. Getting Started Command Syntax command varlist, option This is the simple command syntax in Stata and more conditions can be added as shown in the examples. Preamble mkdir tutorial /* to create a new directory,

More information

MAXQDA Stats Reference Manual. Statistical Analysis with MAXQDA

MAXQDA Stats Reference Manual. Statistical Analysis with MAXQDA MAXQDA Stats Reference Manual Statistical Analysis with MAXQDA Support, Distribution: VERBI Software. Consult. Sozialforschung. GmbH Berlin/Germany http://www.maxqda.com MAXQDA is a registered trademark

More information

AcaStat User Manual. Version 8.3 for Mac and Windows. Copyright 2014, AcaStat Software. All rights Reserved.

AcaStat User Manual. Version 8.3 for Mac and Windows. Copyright 2014, AcaStat Software. All rights Reserved. AcaStat User Manual Version 8.3 for Mac and Windows Copyright 2014, AcaStat Software. All rights Reserved. http://www.acastat.com Table of Contents INTRODUCTION... 5 GETTING HELP... 5 INSTALLATION... 5

More information

Week 1: Introduction to Stata

Week 1: Introduction to Stata Week 1: Introduction to Stata Marcelo Coca Perraillon University of Colorado Anschutz Medical Campus Health Services Research Methods I HSMP 7607 2017 c 2017 PERRAILLON ALL RIGHTS RESERVED 1 Outline Log

More information

Getting Started Guide

Getting Started Guide Getting Started Guide Sage MAS Intelligence 90/200 Table of Contents Getting Started Guide... 1 Login Properties... 1 Standard Reports Available... 2 Financial Report... 2 Financial Trend Analysis... 3

More information

For many people, learning any new computer software can be an anxietyproducing

For many people, learning any new computer software can be an anxietyproducing 1 Getting to Know Stata 12 For many people, learning any new computer software can be an anxietyproducing task. When that computer program involves statistics, the stress level generally increases exponentially.

More information