Act Now Julia

ActNow.analyse_w3_w4_changesMethod

Create a bunch of summaries of the differences between wave 3 and wave4 data

  • joined - hcat of common wave3 and wave4 data
  • wave3 - wave3 data
  • wave4 - wave4 data
  • return dict of images and summary stats for the stacked data and counts for w3 and w4
source
ActNow.create_all_crosstabsMethod

Writes images of each crosstab to e.g. img/crosstab-[policyname]-by-gender.svg

  • index_filename - index file for all the links to images
  • dall - one of w4 or w3 processed datasets (see metaload for steps)

TODO: more breakdowns - switch between .png .svg

source
ActNow.create_one!Method

This convoluted function creates a bunch or binary variables in the dataframe dall for some question and treatments. @param labels - for readable variable names e.g. "basicincome" @param initialq - initial opinion on the thing @param finalq - final (post explanation) opinion @param treatqs - three strings representing the 3 explanations for that thing - abs gains, rel gains, security adds in variables like `basicincometreatabsgains_destitute`

source
ActNow.do_basic_pca_wMethod

See: https://juliastats.org/MultivariateStats.jl/dev/pca/#Linear-Principal-Component-Analysis See: https://www.youtube.com/watch?v=FgakZw6K1QQ

source
ActNow.joinv3v4Method

Merge wave3 and wave4 data on PROLIFIC_ID. return horizontally joined, vertically stacked and a list of items to skip in subsequent regressions if log incomes are NaNs Also, add in_both_waves field to wave4 as a by-product.

source
ActNow.make_all_graphsMethod

Make a bunch of scatterplots for each policy - see draw_policies2 Written to output/img as both .svg and .png

source
ActNow.make_big_file_by_explanvarMethod

Creates all_results_by_explanvar.html with most results broken down by risk of destitution, health, life ladder, etc. -See MAIN_EXPLANDICT for the whole list.

source
ActNow.make_big_file_by_policyMethod

Makes output/all_results_by_policy.html, a big file summarising main wave 4 results, organised by each policy area.

run_regressions() and make_and_print_summarystats() need to have been run beforehand and the output directory filled with regressiona and graph files.

source
ActNow.reweightFunction

Create weights based on voting intention and age/sex groups. NOTE: 0.6-2.8 are the closesy weights I can find that converge using constrainedchisquare.

source
ActNow.summarise_pcaFunction

Summary of one of our Principal Components

  • dall - wave3 or 4 dataset (always 4 in practice)
  • M - output from one PCA analysys (?? type ??)
  • extension - one of 'pre' or 'change'
  • regdir - where to save regressions
source