A Template

Author

Andrew Pua

Published

November 11, 2022

Abstract

Write your abstract here.

Preamble

This template is a radically simplified version of Heiss (2022). This modified template can be found in my course website (Pua 2022). You can combine this template with the first-ever template I shared with you. You could also combine what you may have picked up from other qmd files available at the course website.

Here you can organize the commands needed to load packages and do other formatting options (if needed).

# To clean R's memory, leave this alone
rm(list=ls())

Reading more about Quarto

I am repeating this section from Exercise Set 06. You might find the Quarto guide on the following topics to be of interest:

How to add and cite references

Notice that in the qmd file there is a line bibliography: references.bib. What this means is that there is a separate file containing bibliographic information. Your job is to maintain this bib file and populate it with entries which you will be eventually citing in your report. The format of the entries is the BibTeX format.

Fortunately, almost every publisher of journal articles has citation tools that make things convenient. For example, when you look up the citation information of Hamermesh and Parker (2005) at this website, you will can click on Cite and find Export citation to BibTeX. Sometimes a file will open in your browser, but most of the time a very small file with a .bib or a .txt file extension will be downloaded. Open this file using a text editor and copy/paste the contents to references.bib. Sometimes it might be a good idea to clean up the contents to make it shorter, but still containing the most important pieces of information including the digital object identifier or DOI.1 For other publishers, your mileage may vary. I leave this for you to explore. But you got to admit that this gives everyone no excuse for not citing sources.

If you use R packages that were never used in class, please cite them. For example, if you want to cite the sandwich package, then you type print(citation("sandwich"), bibtex=TRUE) into the R console. It will generate a BibTeX entry. Put that entry into references.bib. Do not forget to put a key. Usually these keys are provided or automatically generated. These keys are markers or identifiers which enable you to tie your citation in the qmd file to the entry in references.bib. If this key is not provided or if you want to modify it, you can find it in the first line of every BibTeX entry. This first line typically starts with something like @Manual{Rcite, and for this example, Rcite is the key.

Open the qmd file which produced this HTML file so that you can see how to cite sources and how the keys play a role.

For reproducibility purposes, I would include something like “All analyses were performed using R Statistical Software v4.2.1 (R Core Team 2022) and tables are displayed using stargazer v5.2.3 (Hlavac 2022). To reproduce the computer output, you need to load the TeachingRatings dataset from Stock and Watson (2012), and install R along with the packages foreign and stargazer.”

Look at the bottom: Instant reference list!

References

Hamermesh, Daniel S., and Amy Parker. 2005. “Beauty in the Classroom: Instructors’ Pulchritude and Putative Pedagogical Productivity.” Economics of Education Review 24 (4): 369–76. https://doi.org/10.1016/j.econedurev.2004.07.013.
Heiss, Andrew. 2022. “Hikmah Quarto Templates.” https://github.com/andrewheiss/hikmah-academic-quarto.
Hlavac, Marek. 2022. Stargazer: Well-Formatted Regression and Summary Statistics Tables. Bratislava, Slovakia: Social Policy Institute. https://CRAN.R-project.org/package=stargazer.
Pua, Andrew Adrian. 2022. “Lecture Materials for Applied Econometrics 1 (2022 Version).” https://applied-metrics.neocities.org/.
R Core Team. 2022. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Stock, James H., and Mark M. Watson. 2012. Introduction to Econometrics. Pearson.

Footnotes

  1. There is a slight problem with some publisher when they export citations to BibTeX. The DOI entry has to modified so that you remove the first part https://doi.org/.↩︎