Compare commits

...

34 commits

Author SHA1 Message Date
2b7bb5c4e7
fix(script): Import dataframes directly from source 2024-07-20 10:19:21 +02:00
8f64604def
chore(repo): Expose dataframes directly from source 2024-07-19 18:09:07 +02:00
f61da38837
fix(code): Only use db references for query calculations 2024-07-16 18:06:48 +02:00
c24e5b3511
chore(repo): Sort reference data into db and snowball 2024-07-16 18:06:23 +02:00
0d723dbfdf
chore(code): Rename prisma calculation variables
Renamed intermediate calculation vars from long and redundant names to
slightly shorter and more coherent versions.
2024-07-16 17:53:37 +02:00
b230228095
chore(code): Remove unnecessary seaborn import 2024-07-16 17:47:41 +02:00
c5df5c01a2
chore(repo): Move yml files to extracted data dir 2024-07-16 17:46:31 +02:00
3ec7dcd1bb
chore(repo): Move zotero references to reference dir 2024-07-16 17:46:31 +02:00
4f9acd0816
chore(repo): Move references to reference data dir
Begin restructuring data dir by separating out references into their own
data sub-dir containing only references and bibtex files.
2024-07-16 15:59:41 +02:00
2a1fc9611f
chore(repo): Move documentation to the docs dir 2024-07-16 15:10:39 +02:00
19e704444a
chore(repo): Rename article quarto profile to journal 2024-07-15 22:33:06 +02:00
503de5ba4b
fix(repo): Update gitignore for new dir structure 2024-07-15 22:27:16 +02:00
9fd4a3c791
chore(repo): Move manuscripts to separate dir
Both the manuscripts for the working paper and the article are now
collected in a separate manuscripts folder.
2024-07-15 22:14:03 +02:00
b4730f6ea8
fix(repo): Rename all references to data and output dir 2024-07-15 21:43:30 +02:00
f384515737
chore(repo): Simplify directory structure 2024-07-15 21:24:35 +02:00
284a3b9281
chore(code): Move dataframe generation to module 2024-07-15 21:15:09 +02:00
38254d1605
feat(code): Add prisma calculation 2024-07-15 21:11:53 +02:00
0d05ed981a
chore(code): Create globals singleton 2024-07-15 20:42:57 +02:00
d2c25a9033
chore(code): Refactor data preparation into process module 2024-07-15 20:42:11 +02:00
562b1eb6a0
chore(code): Do not alias ipython Markdown import 2024-07-15 20:40:51 +02:00
740350eacd
chore(code): Refactor data processing into module 2024-07-15 20:40:50 +02:00
4012ea55f0
fix(script): Use new var names for working paper 2024-07-15 19:56:36 +02:00
4e4f75ff7a
fix(repo): Ensure working dir is always project 2024-07-15 19:53:28 +02:00
d5926b2e88
chore(code): Move validity strength bins to validity 2024-07-15 19:34:20 +02:00
c1eccee426
fix(code): Get data dirs relative to project dir 2024-07-15 10:55:59 +02:00
ad71859ded
feat(script): Move all data transformations to single chunk 2024-07-14 22:07:24 +02:00
ed6c8550b6
feat(script): Move big code chunks out of script 2024-07-14 20:18:57 +02:00
76578e99d3
feat(repo): Add gitignores for elsevier output 2024-07-14 17:22:27 +02:00
45bf434cd9
chore(repo): Update deliverable docx binary file 2024-07-14 17:19:01 +02:00
7bb6ae3101
chore(repo): Improve rendering to elsevier journal 2024-07-14 17:18:07 +02:00
942d129db1
feat(repo): Add article quarto profile 2024-07-14 11:52:32 +02:00
05d8df04c3
feat(repo): Add journal extension 2024-07-14 11:52:32 +02:00
6729bb2c7e
feat (repo): Add outline and deliverable docx files 2024-07-08 18:33:32 +02:00
c2a2a11551
fix(script): Fix gray to grey 2024-07-08 18:33:20 +02:00
315 changed files with 7886 additions and 959 deletions

14
.gitignore vendored
View file

@ -1,6 +1,14 @@
/03-documentation/DB
/03-documentation/library
/04-outputs
/documentation/DB
/documentation/library
/output
/manuscript/*_files/
# Elsevier journal target:
# Ignore bibliography style, spl (for natbib?) and latex class
# since they don't get deleted after compilation
*.spl
*.bst
*.cls
# Created by https://www.toptal.com/developers/gitignore/api/-f,python,linux,vim,quarto,markdown,jupyternotebooks
# Edit at https://www.toptal.com/developers/gitignore?templates=-f,python,linux,vim,quarto,markdown,jupyternotebooks

View file

View file

@ -8,6 +8,9 @@ render: scoping_review.qmd
extract: scoping_review.qmd
poetry extract
poetry prisma
release: scoping_review.qmd
poetry extract
poetry prisma
poetry milestone

View file

@ -1,18 +1,21 @@
# Scoping Review: Inequalities on the Labour Market
This repository contains all data, modelling and processing source code and the complete textual content to reproduce the scoping review study.
The most up-to-date version of this repository can always be found [here](https://git.martyoeh.me/professional/wow-inequalities).
Raw, intermediate and processed data can all be found in the `02-data/` directory:
Raw data include the unmodified database queries using the scoping review search terms.
Intermediate data are made up of the bibtex file produced by Zotero, after tagging and sorting in a Zotero library, ready to be re-imported into the application.
Processed data include the fully extracted studies which make up the main sample for the review.
Raw references, extracted and processed data can all be found in the `data/` directory:
Reference data include the unmodified database queries using the scoping review search terms,
and the bibtex file produced by Zotero after tagging and sorting in a Zotero library, ready to be re-imported into the application.
Extracted data include the fully extracted studies which make up the main sample for the review.
Processed data are ready to import into a dataframe or visualize in a report.
The full article text and code can be found in the `scoping_review.qmd` file.
It makes use of supplementary processing code which resides in the `src/` directory,
mainly to load processed data from the `02-data/` directory and turn it into `.csv` data,
as well as pre-processing those for visualization and validity ranking within the study.
All full texts and visualization code reside in the `manuscripts/` directory.
The full working paper text and code can be found in the `scoping_review.qmd` file.
The full article text can be found in the `article.qmd` file.
They both make use of supplementary extraction and processing code which resides in the `src/` directory,
mainly to load processed data from the `data/` directory and turn it into `.csv` data,
as well as pre-processing for visualization and validity ranking within the study.
## Execution and Reproduction
@ -35,6 +38,6 @@ Now, by invoking `make` the project can be rendered:
make
```
Make will by default extract the processed data and use it to render the full project into a pdf, an html and a docx version of the review, which are deposited in the `04-outputs/` directory.
Make will by default extract the processed data and use it to render the full project into a pdf, an html and a docx version of the review, which are deposited in the `outputs/` directory.
You can invoke any of the `extract`, `render`, `release` steps manually instead by executing e.g. `make extract`.

View file

@ -0,0 +1,19 @@
title: Elsevier Journal Format
author: Charles Teague
version: 0.4.2
quarto-required: ">=1.2.198"
contributes:
formats:
common:
date-format: full
filters:
- elsevier.lua
pdf:
documentclass: elsarticle
template-partials: ["partials/before-body.tex", "partials/title.tex"]
format-resources:
- elsarticle.cls
cite-method: natbib
number-sections: true
html:
theme: styles/elsevier.scss

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="en-US">
<info>
<title>Elsevier - Harvard (with titles)</title>
<id>http://www.zotero.org/styles/elsevier-harvard</id>
<link href="http://www.zotero.org/styles/elsevier-harvard" rel="self"/>
<link href="http://www.zotero.org/styles/ecology-letters" rel="template"/>
<link href="http://www.elsevier.com/journals/biological-conservation/0006-3207/guide-for-authors#68000" rel="documentation"/>
<author>
<name>David Kaplan</name>
<email>david.kaplan@ird.fr</email>
</author>
<contributor>
<name>Simon Kornblith</name>
<email>simon@simonster.com</email>
</contributor>
<contributor>
<name>Bruce D'Arcus</name>
</contributor>
<contributor>
<name>Curtis M. Humphrey</name>
</contributor>
<contributor>
<name>Richard Karnesky</name>
<email>karnesky+zotero@gmail.com</email>
<uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
</contributor>
<contributor>
<name>Sebastian Karcher</name>
</contributor>
<category citation-format="author-date"/>
<category field="biology"/>
<category field="generic-base"/>
<updated>2019-01-22T15:57:12+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="container">
<choose>
<if type="chapter paper-conference" match="any">
<text term="in" prefix=", " suffix=": "/>
<names variable="editor translator" delimiter=", " suffix=", ">
<name name-as-sort-order="all" sort-separator=", " initialize-with="." delimiter=", " delimiter-precedes-last="always"/>
<label form="short" text-case="capitalize-first" prefix=" (" suffix=")"/>
</names>
<group delimiter=", ">
<text variable="container-title" text-case="title"/>
<text variable="collection-title" text-case="title"/>
</group>
</if>
<else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group prefix=", " delimiter=", ">
<text variable="container-title"/>
<text variable="collection-title"/>
</group>
</else-if>
<else>
<group prefix=". " delimiter=", ">
<text variable="container-title" form="short"/>
<text variable="collection-title"/>
</group>
</else>
</choose>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" sort-separator=", " initialize-with="." delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", " initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<text variable="title" form="short" font-style="italic"/>
</if>
<else>
<text variable="title" form="short" quotes="true"/>
</else>
</choose>
</substitute>
</names>
</macro>
<macro name="access">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
<else-if type="webpage post-weblog" match="any">
<group delimiter=" ">
<text value="URL"/>
<text variable="URL"/>
<group prefix="(" suffix=").">
<text term="accessed" suffix=" "/>
<date variable="accessed">
<date-part name="month" form="numeric" suffix="."/>
<date-part name="day" suffix="."/>
<date-part name="year" form="short"/>
</date>
</group>
</group>
</else-if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="report thesis" match="any">
<text variable="title"/>
<group prefix=" (" suffix=")" delimiter=" ">
<text variable="genre"/>
<text variable="number" prefix="No. "/>
</group>
</if>
<else-if type="bill book graphic legal_case legislation motion_picture report song speech" match="any">
<text variable="title"/>
<text macro="edition" prefix=", "/>
</else-if>
<else-if type="webpage">
<text variable="title"/>
<text value="WWW Document" prefix=" [" suffix="]"/>
</else-if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=", ">
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</macro>
<macro name="event">
<choose>
<if variable="event">
<text term="presented at" text-case="capitalize-first" suffix=" "/>
<text variable="event"/>
</if>
</choose>
</macro>
<macro name="issued">
<choose>
<if variable="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</if>
<else>
<text term="no date" form="short"/>
</else>
</choose>
</macro>
<macro name="edition">
<group delimiter=" ">
<choose>
<if is-numeric="edition">
<number variable="edition" form="ordinal"/>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
<text value="ed"/>
</group>
</macro>
<macro name="locators">
<choose>
<if type="article-journal article-magazine article-newspaper" match="any">
<group prefix=" " delimiter=", ">
<group>
<text variable="volume"/>
</group>
<text variable="page"/>
</group>
</if>
<else-if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
<group delimiter=", " prefix=". ">
<text macro="event"/>
<text macro="publisher"/>
</group>
</else-if>
<else-if type="chapter paper-conference" match="any">
<group delimiter=", " prefix=". ">
<text macro="event"/>
<text macro="publisher"/>
<group>
<label variable="page" form="short" suffix=" "/>
<text variable="page"/>
</group>
</group>
</else-if>
<else-if type="patent">
<text variable="number" prefix=". "/>
</else-if>
</choose>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-givenname="true" disambiguate-add-year-suffix="true" collapse="year" cite-group-delimiter=", ">
<sort>
<key macro="author"/>
<key macro="issued" sort="descending"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="issued"/>
<group delimiter=" ">
<label variable="locator" form="short"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>
<bibliography hanging-indent="true" entry-spacing="0" line-spacing="1">
<sort>
<key macro="author"/>
<key macro="issued" sort="descending"/>
</sort>
<layout>
<group suffix=".">
<text macro="author" suffix=","/>
<text macro="issued" prefix=" "/>
<group prefix=". ">
<text macro="title"/>
<text macro="container"/>
<text macro="locators"/>
</group>
</group>
<text macro="access" prefix=". "/>
</layout>
</bibliography>
</style>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,171 @@
-- cite style constants
local kBibStyleDefault = 'number'
local kBibStyles = { 'number', 'numbername', 'authoryear' }
local kBibStyleAuthYr = 'elsarticle-harv'
local kBibStyleNumber = 'elsarticle-num'
local kBibStyleNumberName = 'elsarticle-num-names'
local kBibStyleUnknown = kBibStyleNumberName
-- layout and style
local kFormatting = pandoc.List({ 'preprint', 'review', 'doubleblind' })
local kModels = pandoc.List({ '1p', '3p', '5p' })
local kLayouts = pandoc.List({ 'onecolumn', 'twocolumn' })
local function setBibStyle(meta, style)
if meta['biblio-style'] == nil then
meta['biblio-style'] = style
quarto.doc.add_format_resource('bib/' .. style .. '.bst')
end
end
local function hasClassOption(meta, option)
if meta['classoption'] == nil then
return false
end
for i, v in ipairs(meta['classoption']) do
if v[1].text == option then
return true
end
end
return false
end
local function addClassOption(meta, option)
if meta['classoption'] == nil then
meta['classoption'] = pandoc.List({})
end
if not hasClassOption(meta, option) then
meta['classoption']:insert({ pandoc.Str(option) })
end
end
local function printList(list)
local result = ''
local sep = ''
for i, v in ipairs(list) do
result = result .. sep .. v
sep = ', '
end
return result
end
local bibstyle = kBibStyleDefault
return {
{
Meta = function(meta)
-- If citeproc is being used, switch to the proper
-- CSL file
if quarto.doc.cite_method() == 'citeproc' and meta['csl'] == nil then
meta['csl'] = quarto.utils.resolve_path('bib/elsevier-harvard.csl')
end
if quarto.doc.is_format("pdf") then
-- read the journal settings
local journal = meta['journal']
local citestyle = nil
local formatting = nil
local model = nil
local layout = nil
local name = nil
if journal ~= nil then
citestyle = journal['cite-style']
formatting = journal['formatting']
model = journal['model']
layout = journal['layout']
name = journal['name']
end
-- process the site style
if citestyle ~= nil then
citestyle = pandoc.utils.stringify(citestyle)
else
citestyle = kBibStyleDefault
end
-- capture the bibstyle
bibstyle = citestyle
if citestyle == 'numbername' then
setBibStyle(meta, kBibStyleNumberName)
addClassOption(meta, 'number')
elseif citestyle == 'authoryear' then
setBibStyle(meta, kBibStyleAuthYr)
addClassOption(meta, 'authoryear')
elseif citestyle == 'number' then
setBibStyle(meta, kBibStyleNumber)
addClassOption(meta, 'number')
elseif citestyle == 'super' then
addClassOption(meta, 'super')
setBibStyle(meta, kBibStyleNumber)
else
error("Unknown journal cite-style " .. citestyle .. "\nPlease use one of " .. printList(kBibStyles))
setBibStyle(meta, kBibStyleUnknown)
end
-- process the layout
if formatting ~= nil then
formatting = pandoc.utils.stringify(formatting)
if kFormatting:includes(formatting) then
addClassOption(meta, formatting)
else
error("Unknown journal formatting " .. formatting .. "\nPlease use one of " .. printList(kFormatting))
end
end
-- process the type
if model ~= nil then
model = pandoc.utils.stringify(model)
if kModels:includes(model) then
addClassOption(meta, model)
else
error("Unknown journal model " .. model .. "\nPlease use one of " .. printList(kModels))
end
end
-- 5p models should be two column always
if model == '5p' and layout == nil then
layout = 'twocolumn'
end
-- process the type
if layout ~= nil then
layout = pandoc.utils.stringify(layout)
if kLayouts:includes(layout) then
addClassOption(meta, layout)
if layout == 'twocolumn' then
quarto.doc.include_file('in-header', 'partials/_two-column-longtable.tex')
end
else
error("Unknown journal layout " .. layout .. "\nPlease use one of " .. printList(kLayouts))
end
end
-- process the name
if name ~= nil then
name = pandoc.utils.stringify(name)
quarto.doc.include_text('in-header', '\\journal{' .. name .. '}')
end
end
return meta
end
},
{
Cite = function(cite)
if bibstyle == 'number' then
-- If we are numbered, force citations into normal mode
-- as the author styles don't make sense
for i, v in ipairs(cite.citations) do
v.mode = 'NormalCitation'
end
return cite
end
end,
}
}

View file

@ -0,0 +1,20 @@
\usepackage{float}
\makeatletter
\let\oldlt\longtable
\let\endoldlt\endlongtable
\def\longtable{\@ifnextchar[\longtable@i \longtable@ii}
\def\longtable@i[#1]{\begin{figure}[H]
\onecolumn
\begin{minipage}{0.5\textwidth}
\oldlt[#1]
}
\def\longtable@ii{\begin{figure}[H]
\onecolumn
\begin{minipage}{0.5\textwidth}
\oldlt
}
\def\endlongtable{\endoldlt
\end{minipage}
\twocolumn
\end{figure}}
\makeatother

View file

@ -0,0 +1,41 @@
\begin{frontmatter}
\title{$title$$if(subtitle)$ \\\large{$subtitle$} $endif$}
$for(by-author)$\author[$for(by-author.affiliations)$$it.number$$sep$,$endfor$]{$by-author.name.literal$%
$if(by-author.attributes.corresponding)$\corref{cor1}$endif$%
$if(by-author.note.text)$\fnref{fn$by-author.note.number$}$endif$}
$if(by-author.email)$ \ead{$by-author.email$} $endif$
$endfor$
$for(by-affiliation)$
\affiliation[$it.number$]{organization={$it.name$$if(it.department)$, $it.department$$endif$},$if(it.address)$addressline={$it.address$}$endif$$if(it.city)$$if(it.address)$,$endif$city={$it.city$}$endif$$if(it.country)$$if(it.city)$,$elseif(it.address)$,$endif$country={$it.country$},countrysep={,}$endif$$if(it.postal-code)$$if(it.country)$,$elseif(it.city)$,$elseif(it.address)$,$endif$postcode={$it.postal-code$}$endif$,postcodesep={}}
$endfor$
\cortext[cor1]{Corresponding author}
$for(by-author)$
$if(by-author.note.text)$\fntext[fn$by-author.note.number$]{$by-author.note.text$}$endif$
$endfor$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
$if(journal.graphical-abstract)$\begin{graphicalabstract}
$journal.graphical-abstract$
\end{graphicalabstract}
$endif$
$if(journal.highlights)$\begin{highlights}
$for(journal.highlights)$\item $it$$endfor$
\end{highlights}
$endif$
$if(keywords)$
\begin{keyword}
$for(keywords/allbutlast)$$keywords$ \sep $endfor$
$for(keywords/last)$$keywords$$endfor$
\end{keyword}
$endif$
\end{frontmatter}

View file

@ -0,0 +1 @@
\setlength{\parindent}{6pt}

View file

@ -0,0 +1 @@
/*-- scss:defaults --*/

40
_quarto-journal.yml Normal file
View file

@ -0,0 +1,40 @@
project:
type: default
render:
- manuscript/article.qmd
format:
elsevier-html:
toc: true
code-fold: true
code-tools: true
embed-resources: true
fig-format: svg
link-external-icon: true
number-sections: true
reference-links: true
theme: darkly
docx:
filters:
- pandoc-to-zotero-live
- docx-landscape
echo: false
number-sections: true
reference-doc: data/supplementary/justified.docx
elsevier-pdf:
echo: false
number-sections: true
# see https://github.com/quarto-journals/elsevier
journal:
name: World Development
model: 3p
formatting: review
cite-style: authoryear
highlights:
- Inequality is bad
- Some policies help against inequality
- External validity and internal validity tend to have reciprocal relationship to each other
# execute:
# freeze: true

29
_quarto-workingpaper.yml Normal file
View file

@ -0,0 +1,29 @@
project:
render:
- manuscript/presentation_summary.md
- manuscript/notes.qmd
- manuscript/meeting_eoy.qmd
- manuscript/scoping_review.qmd
toc: true
format:
html:
code-fold: true
code-tools: true
embed-resources: true
fig-format: svg
link-external-icon: true
number-sections: false
reference-links: true
theme: darkly
docx:
echo: false
number-sections: true
reference-doc: data/supplementary/justified.docx
filters:
- pandoc-to-zotero-live
- docx-landscape
pdf:
echo: false
number-sections: true
pdf-engine: tectonic

View file

@ -1,35 +1,11 @@
project:
title: "Key terms and definitions"
output-dir: 04-outputs
render:
- presentation_summary.md
- notes.qmd
- meeting_eoy.qmd
- scoping_review.qmd
output-dir: output
execute-dir: project
toc: true
format:
html:
code-fold: true
code-tools: true
embed-resources: true
fig-format: svg
link-external-icon: true
number-sections: false
reference-links: true
theme: darkly
docx:
echo: false
number-sections: true
reference-doc: 02-data/supplementary/justified.docx
filters:
- pandoc-to-zotero-live
pdf:
echo: false
number-sections: true
pdf-engine: tectonic
profile:
default: journal
bibliography: 02-data/intermediate/zotero-library.bib
bibliography: data/references/zotero-library.bib
csl: /home/marty/documents/library/utilities/styles/APA-7.csl
zoterolive:
library: wow-inequalities

15
data/processed/prisma.mmd Normal file
View file

@ -0,0 +1,15 @@
flowchart TD;
search_db["Records identified through database searching (n=1749)"] --> starting_sample;
search_prev["Records identified through other sources (n=2240)"] --> starting_sample["Starting sample (n=3989)"];
starting_sample -- "Duplicate removal (267 removed) "--> dedup["Records after duplicates removed (n=3723)"];
dedup -- "Title screening (1779 excluded)" --> title_screened["Records after titles screened (n=1944)"];
title_screened -- "Abstract screening (1506 excluded)"--> abstract_screened["Records after abstracts screened (n=438)"];
abstract_screened -- " Language screening (2 excluded) "--> language_screened["Records after language screened (n=436)"];
language_screened -- " Full-text screening (383 excluded) "--> full-text_screened["Full-text articles assessed for eligibility (n=52)"];

Some files were not shown because too many files have changed in this diff Show more