New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Dr. Janiya Bernier


Dr. Janiya Bernier

GPA 3.77


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Economcs

This 5 page Class Notes was uploaded by Dr. Janiya Bernier on Thursday October 22, 2015. The Class Notes belongs to ECON 190 at University of California - Berkeley taught by Staff in Fall. Since its upload, it has received 10 views. For similar materials see /class/226718/econ-190-university-of-california-berkeley in Economcs at University of California - Berkeley.




Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/22/15
Department of Economics Spring 2006 University of California Economics 190 Berkeley Professor Martha Olney Stata Lesson Thursday February 15 2006 1 Where to nd the data sets httpsocsberkeleyeduNolneyspring06econl54 There are four versions of the dataset there tXt excel stata and sas transport le Download all four to your desktop 11 To transfer an excel data set to stata format start translate program choose input le type format here excel or SAS transport browse to nd the data set choose output le type format stata it will automatically suggest a le name choose all variables and all cases select transfer 12 To open the data in txt ascii format start stata know where your data set is type insheet using pathi001txt 13 To read in data that are in fixed format Read the manual Use in X Create a dictionary le that speci es the locations of the variables and their new names Department of Economics Spring 2006 University of California Berkeley Economics 190 Stata Lesson Page 2 of 5 2 To save your work Create a log le File Log Begin or click on the icon that looks like a scroll Choose either formatted log le sch only readable within stata Or text log le log readable within any word processor 3 To look at the data describe list Careful this will go on and on use red X to stop Tabulate tells you how many different occurrences there are of each observed value of a variable useful for variables with just a few possible values not useful for continuous variables Including two variables gives you a crosstab table tab variable name gives a list of all the values and their frequencies eg tab occup How many teachers principals superintendents tab occup sex By gender how many teachers principals superintendents Summarize tells you a variety of summary statistics summarize variable name 0 sum variable name gives brief summary statistics sum variable name detail gives longer list of summary statistics 31 To look at the dataset sorted by some variable two steps Step one sort variable name eg sort sex Step two by variable name sum variable name e g by sex sum totear Department of Economics Spring 2006 University of California Berkeley Economics 190 Stata Lesson Page 3 of 5 4 To start naming the variables label variable variable name variable label Label variable pob Place of Birth 5 To name the values of variables two steps Step one label de ne labelname value name value name Label de ne sexlabel 1 male 2 female Step two label values variablename labelname e g Label values sex sexlabel 6 To create new variables generate newvariable some function of existing variables gen newvariable some function of existing variables Gen numimonthSJaid totearn earnmo 7 To create dummy variables generate dummyvar existing variable value for alummy to equal I generate male sex l 75 To replace values of existing variables replace varname newvalue if varname olalvalue gen female sex replace female 0 if female replace female 1 if female Department of Economics Spring 2006 University of California Berkeley Economics 190 Stata Lesson Page 4 of 5 76 To replace missing values of existing variables 8 replace varname if varname missingvalue Replace age if age 9 T0 graph the data Click graphics along the top menu Choose the type of graphs start with easy graphs Choose a particular graph try scatter plo to start Specify X horizontal axis variable and y vertical axis variables Specify any if restrictions Click submit and the graph will pop up in a couple of seconds Edit your speci cations as you wish click submit again when you have it as you like it save your graph by rightclicking anywhere on graph To run a linear regression regress depvariable independentvariables Re gress totear male To run a probit Probit depvariable independentvariables Generate ownhome ownhm 2 Probit ownhome male totear age To get probit results that are directly interpretable eg Dprobit depvariable independentvariables Dprobit ownhome male totear age Department of Economics Spring 2006 University of California Berkeley Economics 190 Stata Lesson Page 5 of 5 11 eg 12 13 To include only part of the data set add if statements restrict probit to include only teachers Dprobit ownhome male totear age if occ Creating interaction variables Suppose you think that gender matters but not as a constant shift factor You think instead that the effect of gender is to alter the return to college education In that case you need to create an interaction term Gen male grad male grad Now include this as a variable in your regression along with just grad The coef cient on maleigrad tells you if men have a different return to being a college grad than women do NOW let s play With the data set see also data exercise page on class webpage Estimate a relationship between total earnings and its determining variables Think rst about 14 X a how will you take age into account b does gender matter Does it shift the earnings function or change some of the returns or both c do you want separate equations for teachers superintendents principals or do you just want a shift factor for different occupations do files When you have a lot of commands write a do file which contains all of the commands and then have stata run the do le Save the do le in ascii format with the suf x do For instance mondaydo Then type do monday nostop Nostop is an option that tells stata to keep going even if it encounters an error A good place to 100k for help data sets to play with do les etc www aw comstockiwatson


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.