Example: dental hygienist

Introducing Stata—sample session

1 Introducing Stata sample sessionIntroducing StataThis chapter will run through a sample work session , Introducing you to a few of the basic tasksthat can be done in Stata, such as opening a dataset , investigating the contents of the dataset , usingsome descriptive statistics, making some graphs, and doing a simple regression analysis. As youwould expect, we will only brush the surface of many of these topics. This approach should give youa sample of what Stata can do and how Stata works. There will be brief explanations along the way,with references to chapters later in this book as well as to the system help and other Stata will run through the session by using both menus and dialogs and Stata s commands so that youcan become familiar with them a seat at your com

A dataset is far more than simply the data it contains. It is also information that makes the data usable by someone other than the original creator. Although describing the data tells us …

Tags:

  Data, Dataset

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Introducing Stata—sample session

1 1 Introducing Stata sample sessionIntroducing StataThis chapter will run through a sample work session , Introducing you to a few of the basic tasksthat can be done in Stata, such as opening a dataset , investigating the contents of the dataset , usingsome descriptive statistics, making some graphs, and doing a simple regression analysis. As youwould expect, we will only brush the surface of many of these topics. This approach should give youa sample of what Stata can do and how Stata works. There will be brief explanations along the way,with references to chapters later in this book as well as to the system help and other Stata will run through the session by using both menus and dialogs and Stata s commands so that youcan become familiar with them a seat at your computer, put on some good music, and work along with the sessionThe dataset that we will use for this session is a set of data about vintage 1978 automobiles soldin the United follow along by pointing and clicking.

2 Note that the menu items are given byMenu > MenuItem > Submenu Item > etc. To follow along by using the Command window, type the commandsthat follow a dot (.) in the boxed listings below into the small window labeledCommand. Whenthere is something of note about the structure of a command, it will be pointed out as a Syntaxnote .Start by loading theautodataset, which is included with Stata. To use the menus,1. SelectFile > Example Click onExample datasets installed with Click result of this command is fourfold: The following output appears in the large Results window.

3 Sysuse (1978 Automobile data ) The output consists of a command and its result. The command,sysuse , is boldand follows the period (.). The result,(1978 Automobile data ), is in the standard facehere and is a brief description of the : If a command intrigues you, you can typehelpcommandnamein the Command windowto find help. If you want to explore at any time,Help > be informative. The same command,sysuse , appears in the tall Review window to the left. TheReview window keeps track of all commands Stata has run, successful and unsuccessful.

4 Thecommands can then easily be rerun. See[GSW] 2 The Stata user interfacefor more information. A series of variables appears in the small Variables window to the upper [ GSW ] 1 Introducing Stata sample session Some information aboutmake, the first variable in the dataset , appears in the small Propertieswindow to the lower could have opened the dataset by typingsysuse autoin the Command window and pressingEnter. Try this a command that loads (uses) example (system) datasets. As you willsee during this session , Stata commands are often simple enough that it is faster to use them will be especially true once you become familiar with the commands you use the most in yourdaily use of note: In the above example,sysuseis the Stata command, whereasautois the name ofa Stata data data managementWe can get a quick glimpse at the data by browsing them in theData Editor.

5 This can be doneby clicking on theData Editor (Browse)button,, or by selectingData > data Editor > DataEditor (Browse)from the menus or by typing the note: Here the command isbrowseand there are no other the data Editor opens, you can see that Stata regards the data as one rectangular table. Thisis true for all Stata datasets. The columns representvariables, whereas the rows variables have somewhat descriptive names, whereas the observations are data are displayed in multiple colors at first glance, it appears that the variables listed in blackare numeric, whereas those that are in colors are text.

6 This is worth investigating. Click on a cellunder themakevariable: the input box at the top displays the make of the car. Scroll to the right untilyou see theforeignvariable. Click on one of its cells. Although the cell may display Domestic ,the input box displays a 0. This shows that Stata can store categorical data as numbers but displayhuman-readable text. This is done by what Stata callsvalue labels. Finally, under therep78variable,which looks to be numeric, there are some cells containing just a period (.)

7 The periods correspondto missing values.[ GSW ] 1 Introducing Stata sample session 3 Looking at the data in this fashion, though comfortable, lends little information about the would be useful for us to get more details about what the data are and how the data are the data Editor by clicking on its close can see the structure of the dataset bydescribingits contents. This can be done either bygoing toData > Describe data > Describe data in memory or in a filein the menus and clickingonOKor by typingdescribein the Command window and pressingEnter.

8 Regardless of whichmethod you choose, you will get the same result: . describeContains data fromC:\Program Files\Stata13/ado/base/ :74 1978 Automobile Datavars.

9 12 13 Apr 2013 17:45size:3,182 (_dta has notes)

10 Storage display valuevariable name type format label variable labelmakestr18 %-18sMake and Modelpriceint % % (mpg)rep78int % Record 1978headroomfloat % (in.)trunkint % space (cu. ft.)weightint % (lbs.)lengthint % (in.)turnint % Circle (ft.)displacementint % (cu. in.)


Related search queries