actnow.jl

Files and data to replicate the results of the Act Now series of papers.

https://github.com/grahamstark/actnow.jl

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Files and data to replicate the results of the Act Now series of papers.

Basic Info
  • Host: GitHub
  • Owner: grahamstark
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Size: 3.87 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Created over 1 year ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

Act Now Replication Code and Data.

This repository contains the code and data used to create the statistics and graphs used in the Act Now series of papers.

The code here produces a lot of analysis, including linear regressions, summary statistics, principal components, Stuctural Equation Model (SEM) analysis and cross-tabulations. Each of the papers concentrates on one of the ten policy areas in the survey and as such uses only a small subset of these results. Unfortunately, this means that you may have to do some digging in the output to find a particular result.

Most of the results are produced using the Julia language. The exception is the SEM, which is implemented in R using the Lavaan library - this is because the Julia SEM Implementation failed to converge and I don't have the time (and maybe the skill) to investigate why fully.

Instructions:

Install Julia and R

Download and install julia language for your OS. I used the latest (1.11.1) Linux version. Please don't install in any other way e.g. via a Unix package manager or a software centre.

Install R 4.xx if needed - via Cran, your institute's software centre, or a package manager.

Clone or copy this repository.

The code and data is packaged as a Julia package and uploaded to GitHub.

To get everything:

If you have a Git client, execute:

git clone git@github.com:grahamstark/ActNow.jl.git

Otherwise, download a zipfile. Click on the green "Code" button on the RHS of the repository homepage and select "Download Zip". Unpack the zipfile somewhere.

The repository should contain:

  • src - Julia source code - there are several source 'include files' and a main file ActNow.jl which just consolidates everything;
  • data - the main act now survey files and edited versions with various created files - e.g. recoded responses;
  • R - a single R file with the SEM analysis;
  • output - an initially empty directory into which all results are written. Contains regressions and img subdirectories;
  • docs - autogenerated Julia function docs.

Julia Code - Instantiate and Run

Start the Julia REPL (Read–eval–print loop). On Windows, you can navigate to the ActNow directory with (e.g.):

cd( "c:\\users\\gwdv3\\ActNow.jl")

Or, if you're using the command line on Mac/Linux, you can do (e.g.):

cd /home/graham_s/ActNow.jl

(Or whatever the Powershell equivalent is).

You can download all the needed libraries and create all the output by running:

include("scripts/julia_driver.jl")

This may take a while on 1st run as there are a good few libraries to compile.

Alernatively, open scripts/julia_driver.jl with a text editor and paste the bits you need into the REPL. There are quite a lot of comments in the file.

Most of the analysis uses extended versions of the wave3 and 4 original datasets, with some recoded variables and derived variables added. You can verify the creation of these variables by removing the comment on the line

wave4 =  make_dataset_v4()

close to the top of the driver script.

Output goes to output, not unreasonably. Subdirs:

  • img - graphs
  • regressions - raw linear regression output created with Regression Tables.
  • regressions_w3_w4

The output files:

all_results_by_policy-extremes_excluded.html
all_results_by_policy-fullsample.html

consolidate almost all the output used in the papers. The sole difference between them is that the regression results in all_results_by_policy-extremes_excluded.html remove the observations scoring 0 or 100 for the given policy.

The SEM Model

The SEM model is implemented in R using the file file R/sem-model.R. You should be able to install the required packages and run the script with any R 4.x.

Start an R session in the root directory of the ActNow project and include the file with:

source( "R/sem_model.R")

The R script should write text files to output and write .pdf format diagrams to output\img\.

Note there are a bunch of install.libraries commands at the top of the script which need to be run at most once.

Owner

  • Name: Graham Stark
  • Login: grahamstark
  • Kind: user
  • Location: UK
  • Company: Virtual Worlds Research

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Johnson"
  given-names: "Elliot"
  orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Johnson"
  given-names: "Matthew"
  orcid: "https://orcid.org/0000-0002-9987-7050"
- family-names: "Nettle"
  given-names: "Daniel"
  orcid: "https://orcid.org//0000-0001-9089-2599"
- family-names: "Stark"
  given-names: "Graham"
  orcid: "https://orcid.org/0000-0002-4740-8711"
title: "Replication Code for Act Now Project"
version: 1.0.0
# doi: 10.5281/zenodo.1234
date-released: 2024-11-04
url: "https://github.com/grahamstark/ActNow.jl"

GitHub Events

Total
  • Release event: 2
  • Push event: 27
  • Create event: 3
Last Year
  • Release event: 2
  • Push event: 27
  • Create event: 3