cboettig / knitcitations

:package: Generate citations for knitr markdown and html files
http://carlboettiger.info
Other
220 stars 28 forks source link

Error: Missing the institution field in TechReport #86

Open jjchern opened 8 years ago

jjchern commented 8 years ago

I tried to generate a bibentry for a NBER working paper with a doi "10.3386/w15616" (citet("10.3386/w15616")), but got the following error

Ignoring entry 'Chetty_2009' (line1) because:
    A bibentry of bibtype ‘TechReport’ has to specify the field: institution

Error in if (entry$key %in% keys) { : argument is of length zero

I wonder if this is something that can be fixed, because I do find the an institution field provided by the NBER website http://www.nber.org/papers/w15616.bib:

@techreport{NBERw15616,
 title = "Bounds on Elasticities with Optimization Frictions: A Synthesis of Micro and Macro Evidence on Labor Supply",
 author = "Raj Chetty",
 institution = "National Bureau of Economic Research",
 type = "Working Paper",
 series = "Working Paper Series",
 number = "15616",
 year = "2009",
 month = "December",
 doi = {10.3386/w15616},
 URL = "http://www.nber.org/papers/w15616",
 abstract = {How can price elasticities be identified when agents face optimization frictions such as adjustment costs or inattention? I derive bounds on structural price elasticities that are a function of the observed effect of a price change on demand, the size of the price change, and the degree of frictions. The degree of frictions is measured by the utility losses agents tolerate to deviate from the frictionless optimum. The bounds imply that frictions affect intensive margin elasticities much more than extensive margin elasticities. I apply these bounds to the literature on labor supply. The utility costs of ignoring the tax changes used to identify intensive margin labor supply elasticities are typically less than 1% of earnings. As a result, small frictions can explain the differences between micro and macro elasticities, extensive and intensive margin elasticities, and other disparate findings. Pooling estimates from existing studies, I estimate a Hicksian labor supply elasticity of 0.33 on the intensive margin and 0.25 on the extensive margin after accounting for frictions.},
}
cboettig commented 8 years ago

Unfortunately this is a probably a problem on the publisher's end (though knitcitations should be able to deal with it more gracefully). The data is missing from CrossRef's database, and it is the publisher's responsibility to report this metadata to CrossRef in exchange for getting a DOI. CrossRef isn't very strict about missing data, and knitcitations gets the data from CrossRef. Unfortunately bibtex (or biblatex) is more strict about missing data, hence the error.