hw_6. STATA for Description

PubHlth 691f – Fall 2014
6. STATA for Data Description
Page 1 of 2
Unit 6 – STATA for Data Description
Homework/Practice # 8
Due: Monday October 27, 2014
Last Submission Date for Credit: Monday November 3, 2014
Dear class,
The goal of this assignment is for you to gain familiarity with producing descriptive statistics and an
appreciation for which to use when. .
You will be using ONE data set, depending on which size Stata you purchased:
Small Stata purchasers ONLY: Type the following into the command window:
use “http://people.umass.edu/biep691f/data/descriptive_gss_small.dta”
All Others: Type the following into the command window:
use “http://people.umass.edu/biep691f/data/descriptive_gss.dta”
Descriptive_gss.dta contains 2,765 observations
descriptive_gss_small.dta contains 900 observations..
Preliminaries
(1) Launch Stata
(2)
Begin a log of your session, taking care to use the extension .log
(3) In the command window, type: set more off
(4) In the command window, type in ONE of the following, depending on your Stata.
use “http://people.umass.edu/biep691f/data/descriptive_gss_small.dta”
use “http://people.umass.edu/biep691f/data/descriptive_gss.dta”
HW_6. STATA for Data Description.doc
PubHlth 691f – Fall 2014
6. STATA for Data Description
Page 2 of 2
___ 1. This exercise gives you practice producing descriptive statistics for continuous variables.
___ (a) At the command line, type help tabstat. Scroll down to review the choices for
descriptive statistics that can be obtained.
___ (b) Obtain detailed descriptive statistics for the continuous variable hrs1.
___ (c) Use the command tabstat, together with the appropriate options, to produce a
tabular display of some descriptive statistics for each of the variables hrs1, age, and wwwhr
___ (d) See again the example of the use of tabstat on page 26 of your unit 6 notes.
___ (e) Using the command tabstat, together with the appropriate options, produce
descriptive statistics for the variable hr1, separately for strata defined by polviews
___ 2. This exercise gives you practice producing descriptive statistics for discrete variables.
___ (a) Obtain oneway frequencies and relative frequencies for the variables marital, sex,
and satjob7
___ (b) Obtain a two way cross tabulation, with row percentages, of sex and polviews.
___ 3. This exercise gives you practice editing your session to eliminate errors and then saving.
___ (a) Before exiting Stata, close your log.
___ (b) Launch Word. Open your stata log. Fix all your errors and delete all the error
messages.
___ (c) Use FILE > SAVE to save your cleaned work to a new file that you name using
the convention lastname_hw08.doc
___ (d) By any means you like, create a pdf that you name using the convention lastname_hw08.pdf
HW_6. STATA for Data Description.doc