stata代写-ECON306
时间:2022-10-25
Name: Email ID: @psu.edu
Worked with these other students:
ECON306 Problem Set 4
INSTRUCTIONS: Solve the following questions to the best of your ability. Ask me if
you do not know how to solve any of these questions before the due date. I will work with
you if you are having trouble solving these.
To receive full credit for this assignment, the problem set needs to be submitted to Canvas
in a single PDF document containing your 1) Stata log file in a .pdf file and 2) any
written explanations and answers. All of these components need to be attached together in
that order. Late submissions will NOT be accepted. DO NOT email! No assignments will be
accepted via email.
First of all, for this problem set, you will have to submit the Stata log file. Stata can
record your session into a file called a log file but does not start a log automatically; you must
tell Stata to record your session. By default, the resulting log file contains what you type
and what Stata produces in response, recorded in a format called Stata Markup and Control
Language (SMCL). The file can be printed or converted to plain text for incorporation
into documents you create with your word processor. You can find more information here:
https://www.stata.com/manuals13/u15.pdf.
So, in the beginning of your Stata .do file write the following command: log using PSX,
replace (or a different file name). Then, at the very end of your .do file, include log close and
then on a new line translate PSX.smcl PSX.pdf. This would translate your Stata SMCL log
files directly into PDF files and then use Adobe Acrobat to merge PDF files together. You
will need to turn in this log file to receive full credit for this assignment.
Please compile the log file in Stata after you have completed all of your code and
can run it smoothly without any errors. In that way, your log file would not contain
any lines of code that do not produce any results or any duplicate results. Please do your
best to include comments in your code (using the ∗ sign in your Stata .do file) and to make
the solutions to the different problems as clearly marked as possible. Otherwise, the graders
might have to penalize you, if they cannot follow your work. And then I will have to re-grade
your work and the whole process becomes highly inefficient.
ECON 306 Problem Set 4, Fall 2022 Page 2
Bienvenidos a Miami
The data set Walkability 306HW.dta contains data from 2011 on 3,423 observations of homes
in Dade County, Florida. There is not a description document to go with this data set be-
cause all the variables are named and some of them have notes. You may have noticed on
your own that if you type the command “describe” then you will see an asterisk next to
some of the variable labels. The legend for the ∗ tells that those indicated variables have
notes. In order to see them you can type the command “notes”
Other Stata tips: 1) If you’re having a hard time finding variables, you can type the
command ”aorder” to put them in alphabetical order. You’ll see that capital letters are all
considered to come before lowercase letters. 2) Use quotation marks to find a string. For
example, generate father=0 replace father=1 if relationship==”father” Basically, the
quotes tell Stata that you’re not looking for a number but rather for text.
1 Creating Variables
a) Create a dummy variable called owner occupied = 1 if the home is owner occupied.
b) Create a dummy variable called bighouse that equals 1 when a home has more than 3
bedrooms. Interact that dummy with the pool dummy variable called bighouse pool.
c) Create a variable called age which represents how old the home is at the time of data
collection. Also make a variable age2 equal to the squared age of a home.
d) Create a variable called ln pop that represents the natural log of the block group popu-
lation
e) Likewise, create variables called ln sqft and ln lotsize
2 Measurement Error
a) I have created the variables noisy value and noisy sqft which have random noise added to
the actual variables. Take a look at the relationship between these variables by creating
a variable equal to the difference between the reliable and noisy data for value then
summarize your new variable. You can, but do not need to, do the same thing for the
square footage.
b) Perform the regression
̂mkt value = βˆ0 + βˆ1baths+ βˆ2bedrms+ βˆ3CBD dist+ βˆ4lotsize+ βˆ5sqft
then predict what your coefficient will be if you use the noisy value of square footage
instead of the actual value. The standard deviation of the noise on noisy sqft is σw = 100
square feet. Why did your actual result differ from your prediction?
ECON 306 Problem Set 4, Fall 2022 Page 3
c) Starting with ̂mkt value = βˆ0 + βˆ1baths+ βˆ2bedrms+ βˆ3CBD dist+ βˆ4lotsize+ βˆ5sqft,
predict how the R2, R¯2, the coefficient on sqft (not the noisy one), and the standard error
of that coefficient will change if you use the noisy variable for market value. Was your
prediction correct?
3 Logarithms
a) Perform the regression used in part 2b with the reliably-measured variables. Add the
variable for population of the census block group.
b) Next, perform the same regression but this time using the natural log of the block group
population instead. Interpret the coefficient on population in both the logged and non-
logged models. Comment on which variable seems more appropriate and why.
c) Keep the population logged but change the dependent variable to ln(market value). In-
terpret the coefficient on population. Do you think that the model is better with or
without market value being logged? Why?
d) Finally, estimate a log-linear model and interpret the coefficient on block group popula-
tion.
e) Which of the different specifications in this question do you think produced the best
result to share your analysis? Are there any other changes that you would make to the
regressors if you could run one more model?
f) Go ahead and run your new-and-improved model to see if it gives you any better results.
Comment on your success or lack of success.
essay、essay代写