stata代写-EC639

EC410C/EC639 Assignment (100 marks total)

Instructions: hand in your answers in a single file (plus log file) through MyLearningSpace, in
the Dropbox. You may use pen/pencil and draw diagrams/equations on paper, and then take
pictures of these diagrams. Insert these pictures into your Word document/PDF and submit
everything as one file. Please do your own work and do not hand in someone else’s answers,
although you may discuss questions with other classmates.

Steps to assignment

1. Complete questions 1-4. Diagrams can be drawn and scanned or pictures inserted into
2. Do the data analysis needed for question 5. Be sure to do the “set seed” step (see below).
Generate a log file for all of your steps in Stata, and include a PDF of your log file in
your submission so I can verify you did your own analysis. You can submit a separate
3. Using the Stata analysis, answer question 5. Include the table of regression results and
written answers in the same document as questions 1-4.
4. Compile everything into one file (Word or PDF) including your log file (save as a PDF
and then append to your other answers) if possible. If you need to submit your log file
separately as another PDF that is fine as well.

Questions

1. (16 marks) In a Ricardian model, there are two countries: Canada (has 600 units of
labour) and Japan (has 300 units of labour). Two goods are produced: pancakes and
waffles. The unit labour requirements are:

= 10
= 3

= 3
= 1.5

any)? Show your work for full marks.
b) (4 marks) draw the RS curve, including the relative prices at the horizontal steps and
the relative quantity on the vertical part.
c) (4 marks) Suppose that Canada and Japan open up to trade. Assume that the RD curve
intersects the RS curve when the relative price of pancakes equals 3. Show the gains
from trade for Japan using a diagram and labelling relevant parts of the diagram with
numbers. Summarize how Japan gains from trade in words as well, in a brief
sentence.
d) (4 marks) Suppose both countries double the amount of labour they have. Draw and
explain how the RS curve would change (including any labelled values in b)), and
briefly explain how this would affect the pattern of trade.

2. (17 marks) in an HO model, there are two countries: Gondor (capital abundant) and
Mordor (labour abundant). Two goods are produced: catapults (capital-intensive) and
spears (labour-intensive). Express everything in terms of catapults.
a) (4 marks) Draw an RS-RD diagram showing the two countries relative supply curves
in terms of catapults. Use this diagram to argue what would happen to the relative
price of catapults in Gondor if it opens up to trade with Mordor.
b) (8 marks) Describe what happens to the following things in Gondor when it opens up
to trade with Mordor: w/r, L/K per sector, output per sector. Use diagrams when
necessary to show what happens to each.
c) (5 marks) Suppose that you observe, in reality, Gondor and Mordor opening up to
trade. You see that Gondor exports the good whose relative price drops from pre to
post-trade. Is this enough to conclusively prove that HO-based comparative
advantage drives the pattern of trade? If yes, argue why and how the evidence rules
out other models, including those of comparative advantage. If not, explain why and
what other evidence you would want to see to prove that HO-based comparative

3. (17 marks) increasing returns to scale with symmetric firms:
a) (5 marks) Show, using algebra, what happens to the varieties available to consumers
(n) and prices when one country opens up to trade with another identically sized
country.
b) (4 marks) Suppose that the marginal cost c decreases. Explain how this affects: i) pre-
trade prices, ii) pre-trade number of firms/varieties, and iii) the size of the gains from
trade in terms of the price drop (hint: similar to c) from the practice problems!).
c) (4 marks) Suppose that b = 1, F = 10, c = 2. If France has a market size of 1000 and
Germany has a market size of 2000, calculate the change in varieties available to
French consumers as well as the change in price to French consumers.
d) (4 marks) Using the same values and setup as part c), suppose that the French
manufacturers’ association claims that the losses in manufacturing employment in
France exceed any gains from trade. Suppose that France contains 1/3 of the post-
trade firms that exist after market integration with Germany. Suppose also that each
unit of output costs 2 workers to produce. If we further assume that each
manufacturing worker is worth \$30, what would the gains from trade have to be less
than in order for the claim by the French manufacturers’ association to be true?

4. (26 marks) Melitz model questions:
a) (4 marks) Derive a firm’s profit function in terms of its productivity, () =

()−1 − . You can use the equation for a firm’s price in terms of its
productivity and the fact that revenues are equal to [
()

]
1−
.
b) (4 marks) Solve the firm’s profit maximization problem to derive what price a firm
charges given its productivity .
c) (6 marks) Derive the cutoff productivity for exporting and show why all exporters
will always operate in the domestic market as well (i.e. that cutoff for exporting is
higher than domestic cutoff)
d) (6 marks) Explain how opening up to trade in the Melitz model benefits consumers
via larger varieties and lower prices. Use algebraic expressions when possible, and
intuitive explanations otherwise.
e) (6 marks) We can express the post-trade varieties available to consumers as (1 + ∗
), where is the amount of domestic varieties available in a country post-
trade, n is the number of other countries in the world, and is the probability
that a firm draws a productivity high enough to enable them to export. Suppose that
is the autarky (no-trade) amount of varieties available to consumers in a given
country. We know that < because of exit of the lowest-productivity consumers
post-trade. Use (1 + ∗ ) to show how post-trade, the number of varieties
available to consumers in a given country might potentially be smaller (hint: it might
help to expand the term and remember that all countries are identical).

5. (24 marks) This question will require the use of the dataset, ADH_L5.dta. In addition to
used to generate the regression output needed, as well as any data cleaning you did from
the base dataset (i.e. open the log file first thing after opening Stata, before even opening
the assignment dataset). If you don’t know how log files work, you can type “help log”
into the Stata command window or look up online resources to help with log files in
Stata. Not including a log file will result in penalties including getting a zero on this
question. You can save the log file as a PDF after generating it and include it in your
submission as a separate file on MyLS, or combine the log file with your Word document
and hand everything in as one file.

Before starting, note a few things. First, always use heteroskedasticity robust standard
errors unless otherwise stated. Second, I want you to implement the following steps in
Stata immediately after you open the dataset:

set seed abcd
gen x = rnormal()
sort x
keep if _n<=500
drop x

In the above code, replace abcd with the last 4 digits of your student number. If you
remember from our project paper selection, this generates a unique random variable x,
which you will then sort. The next step (keep if…) will keep only the first 500
observations in your data, which will be unique for each student because of the random
sorting. Note that this means all coefficients should be different for every student, so
please be sure to do your own work! Handing in identical numbers as another student

For all regressions, the dependent variable (left hand side) will be the log of average
weekly wages for manufacturing workers in USD; this is called l_avg_lnwkwage_mfg in
the dataset. The main independent variable will be exposure to Chinese imports (in
thousands of USD) per worker in a given commuting zone; this is called l_tradeusch_pw
in the data.

Some of the Stata commands you may find useful are already listed in the metrics review
lecture slides. If you ever need help with how a particular command is supposed to be
used, you can either type help and then the name of the command, or go online and
search for the command (typing the command name and then Stata usually does it); this
should pop up the help files for each command.

Here is a table of other variables for the analysis:

Variable name in data description
l_tradeotch_pw instrument (IV) for import exposure
l_sh_empl_f share of employed people that are female
l_sh_popfborn share of population born outside US
l_popcount population
l_sh_popedu_c share of population with a college degree
l_sh_routine33 share of employment in “routine” jobs
that don’t require a lot of creativity or
problem solving that can be done by
following sets of rules or instructions

for this question, submit your log file containing all work done to generate results.
Not performing the “set seed” set of steps above will result in loss of marks in this
question.

a) (12 marks) Produce a table with the following 4 regressions displayed:
i) a regression with wages on the LHS and import exposure on the RHS
as described above,
ii) same regression as i), but including an additional control variable
(don’t choose the IV!) of your choice from the table,
iii) same variables as ii) but now using the instrument for the import
exposure measure,
iv) same regression as in iii) but clustering standard errors by state.
Each column in your table should be a different regression, and you should
include coefficient estimates + standard errors for each variable and report the R-
squared and observation counts of each regression. For an example of table
formatting from one of my own papers, see below after all the questions.
b) (4 marks) Explain why you chose your additional control variable in a) ii); what issue
is its inclusion resolving (be as specific as possible, referencing the specific variable)?
Look at the coefficient estimates across regressions i) and ii): what does any change
(or lack of change) in the coefficients tell you about what your control variable is
doing?
c) (4 marks) Compare columns ii) and iii) in your table, and describe the difference in
the coefficient on import exposure, if any. What does the difference in the coefficient
(if any) tell you about whether there were issues using only OLS?
d) (4 marks) Compare the coefficients and standard errors obtained between columns iii)
and iv). Using your results, explain whether clustering makes any difference in the
coefficients, standard errors, or levels of statistical significance. Use these
comparisons to briefly explain why using clustering incorrectly (or not at all) may

Example of regression table formatting (resize table if it’s too small on your screen)