ECN 102 UC Davis Analysis of Economics Data Questions ANALYSIS OF ECONOMICS DATA, THE ASSIGNMENT IS ass1s20.pdf, ONLY FINISH THE QUESTION 1, 2 ,3 ECN 102 P
ECN 102 UC Davis Analysis of Economics Data Questions ANALYSIS OF ECONOMICS DATA, THE ASSIGNMENT IS ass1s20.pdf, ONLY FINISH THE QUESTION 1, 2 ,3 ECN 102 Prof Cameron
FORMAT FOR ASSIGNMENT ANSWERS
Answer questions including key Stata output.
Separately include a log file or key parts of logfile see below.
Try to keep assignment length brief. E.g. graphs can be fairly small.
EXAMPLE QUESTION (No need to include the question)
1. The data set AED_EARNINGS.DTA contains data.
(a) Read the data into Stata.
(b) Give the mean and standard deviation of annual earnings (variable earnings)
(c) Obtain a histogram of earnings. Do the data appear to be normally distributed?
2. etcetera
EXAMPLE ANSWER
1.(a) Data read in see logfile
(b)
. summarize earnings
Variable |
Obs
Mean
Std. Dev.
Min
Max
————-+——————————————————–earnings |
171
41412.69
25527.05
1050
172000
The mean is $41,412 and standard deviation is $25,527.
0
5.0e-06
Density
1.0e-05
1.5e-05
2.0e-05
(c) The histogram is
. histogram earnings
(bin=13, start=1050, width=13150)
0
50000
100000
150000
Annual earnings (in dollars)
200000
The data do not appear to be normally distributed (they are right skewed not symmetric).
2.(a) etcetera
Log file
Include log file.
Shorten if there is irrelevant or lengthy output.
For example if you give the list command this could give many pages of output.
There may be more than one logfile if you did not do assignment all at once.
. log using “C:UsersccameronDropboxDesktopTEACHING102assignmentsass1output.log”
———————————————————————————————name:
log: C:UsersccameronDropboxDesktopTEACHING102assignmentsass1output.log
log type: text
opened on:
6 Apr 2020, 11:28:14
. use “C:UsersccameronDropboxDesktopTEACHING102assignmentsAED_EARNINGS.DTA”
(Data for A. Colin Cameron (2015): Analysis of Economics Data, W.W. Norton)
. summarize earnings
Variable |
Obs
Mean
Std. Dev.
Min
Max
————-+——————————————————–earnings |
171
41412.69
25527.05
1050
172000
. histogram earnings
(bin=13, start=1050, width=13150)
. log close
name:
log:
log type:
closed on:
C:UsersccameronDropboxDesktopTEACHING102assignmentsass1output.log
text
6 Apr 2020, 11:36:40
Economics 102: Analysis of Economic Data Spring 2020
Department of Economics, U.C.-Davis
Assignment 1: Due 9.00 a.m. Friday April 10
Worth 4% of course grade. No credit for late assignments.
Post answers as a single pdf at Canvas / Gradescope.
Keep Answers as brief as possible.
Include key Stata output with answers including log
le open and close.
For help on getting going in Stata see the Stata handouts on the web at
http://cameron.econ.ucdavis.edu/stata/stataintro.html
and the video on using the virtual lab in Canvas / Files / Extra Zoom Links
It is best to use Stata in the following way:
1. Download any data
les into your working directory.
2. Start Stata and change the directory to your working directory using the File menu and
then Change Working Directory ….
3. Create a log
le that saves results from the session.
Using the File menu this is Log / Begin and save as a log
le (and not the default smcl
le)
If you instead use the command line type e.g. log using ass1results.log, replace
(The replace means that any previous
le named ass1results.log will be over-written).
4. Read in the data.
For a Stata dataset use File / Open.
Or if using the command line this is the use command e.g. use xyz.dta.
For other data formats it is File / Import.
Or if using the command line this is the import command – for details help import.
Example: import delimited using xyz.csv, comma
If typing data in from the keyboard use command input and end.
5. Once data is read in if it was not a Stata dataset then save it as a Stata dataset.
Then next time you can read in a Stata dataset which is simpler.
6. The log
le does not include graphs.
To save any graphs you can cut and paste them into your assignment solutions document.
Or directly save the
le in Stata.
In the Graph Window go to File / Save and chose a format such as WMF
Or if using the command line give e.g. command graph export ass1q1graph1.wmf, replace
7. When you leave Stata save the log
le.
Either File / Log/ Close or give the command log close
8. The Stata output log
le is a text
le with everything properly aligned if you saved the log
le as .log and then read it using a
xed character width font. A good font to use if using e.g. MS
Word is Courier New. A font size of 9 prevents wraparound of results.
9. To save paper just print out the key results for the assignment. Leave spaces to be able to
write in (or type in) answers to the associated questions.
10. For printing on a black and white printer, which is cheaper, graphs will print better if you
explicitly use a black and white scheme.
Best is before creating and graphs give the Stata command set scheme s1mono.
Or Graphics / Change scheme can be used.
1
1. Cross-section Data Example and manually read in data
A sample of 15 people aged 30 had the following number of annual doctor visits: 3, 1, 3, 4, 5, 1,
2, 7, 8, 0, 0, 6, 1, 0, 0.
(a) Read the data into Stata. There are several ways to do this.
(1) Use command input. In the command line give a series of commands:
input docvis
3
..
.
0
end
or (2) Create a .csv
le and then File / Import / Text data ….
or in the command line give command import delimited ….
or (3) Use the Stata data editor accessed by Data / Data Editor
(b) Obtain summary statistics from Statistics menu or more simply give command summarize.
(c) Give the inter-quartile range (this requires the detail option of the command summarize).
So summarize, detail
(d) List the
rst
ve observations using Stata command list in 1/5
(e) Obtain a table of frequencies for these data using Statistics / Summaries, tables and tests /
Frequency tables / One-way table.
What simple Stata command would provide this?
(f) Obtain a histogram using Graphics / Histogram and choosing the Data are discrete option to
have a bin width of one for these discrete data.
What simple Stata command would provide this?
Do the data appear to be normally distributed?
(g) Obtain a pie chart using Graphics / Pie and within this in the Main tab choose Graph by
categories.
What simple Stata command would provide this?
(h) Obtain a bar chart of the frequencies of each count in the easiest possible way.
Hint: modify the previous Stata command.
2. Cross-section Data Example and read in data from a Stata .dta
le
The data set ass1_wages.dta (posted at Canvas) contains data.
(a) Read the data into Stata using command use.
(b) Obtain a description of the variables using command describe.
(c) Obtain summary statistics for the hourly wage, using the detail option.
Given the results do the data appear to be normally distributed?
(d) Obtain a box plot for the hourly wage, using the graph box command.
Does there appear to be outlying observations?
(e) Obtain a histogram of the hourly wage.
Do the data appear to be normally distributed?
(f) Generate a variable for the natural logarithm of the hourly wage.
(g) Obtain summary statistics for the natural logarithm of the hourly wage, using the detail
option.
Given the results do the data appear to be normally distributed.
(h) Obtain a smoothed histogram of the natural logarithm of hourly wage using the kdensity
command. Do the data appear to be normally distributed?
2
3. Summary
PnStatistics
(a) Obtain i=1 zi for the following cases with n = 4: (1) zi = 2. (2) zi = i. (3) zi = 2i3 . (4)
zi = 1=i.
(b) Compute from
rst principles (i.e. using the formula and a calculator) the mean, standard
deviation, and coe¢ cient of variation for the sample 24, 16, 18, 6. Show all calculations.
(c) IQ scores have a mean of 100, standard deviation of 14 and are approximately normally
distributed. What range of IQ scores do you expect 95% of the population to lie in?
4. Types of Economic Data
For each of the following examples state whether the data are numerical or categorical, and state
whether the data are cross-section, time series or panel data.
(a) Quarterly data on the level of U.S. new housing construction from 2000 to 2019.
(b) Data on number of doctor visits in 2019 for a sample of 180 individuals.
(c) Data on annual health expenditures for each U.S. state from 2000 to 2019.
(d) Data on usual mode of transportation used to commute to work for a sample of 171 individuals.
5. Types of Economic Data
For each of the following state whether the data are observational or experimental
(a) Data on earnings for individuals some of whom chose to participate in a training program and
some who did not.
(b) Data on earnings for individuals some of whom were randomly assigned to a training program
and some who were not.
(c) Data on school outcomes for charter schools and for traditional schools.
3
Purchase answer to see full
attachment
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.