The project contains the code and correlation matrices for the paper *What is central to belief system networks?*
**This project contains the following files.**
# Code
## Custom Functions
- NCTmissing.R: code from NetworkComparisonTest, but adjusted to use fiml for missing data
- tidystatfunctions.R: functions to store data in tidystats format for tests not covered by tidystats
## R code
- master.R: code to run all of the analyses
### Estimate Networks and Centrality with all the available data in each wave
- estimate networks.R
- estimate centrality defaults.R
- estimate centrality ranked.R
### Estimate Networks and Centrality with only items available in at least 6 waves
- estimate networks at least 6.R
- estimate centrality defaults at least 6.R
- estimate centrality ranked at least 6.R
### Estimate Networks for people high and low in political knowledge for all available data
- political knowledge networks.R
- political knowledge estimate centrality defaults.R
- political knowledge estimate centrality ranked.R
### Estimate Networks for people high and low in political knowledge with only items available in at least 6 waves
- political knowledge networks at least 6.R
- political knowledge estimate centrality defaults at least 6.R
- political knowledge estimate centrality ranked at least 6.R
### Estimate Networks for people high and low in political knowledge using quartiles (suggested by reviewer)
- political knowledge networks quartiles.R
- political knowledge quartiles estimate centrality defaults.R
### Estimate Networks for people high and low in education for all available data
- education networks.R
- education estimate centrality defaults.R
- education estimate centrality ranked.R
### Estimate Networks for people high and low in education with only items available in at least 6 waves
- education networks at least 6.R
- education estimate centrality defaults at least 6.R
- education estimate centrality ranked at least 6.R
### Estimate Networks for voting and behavior
- behavior network.R
- behavior network at least 6.R
### Estimate education and political knowledge differences for voting (suggested by reviewer)
- behavior network with knowledge.R
## Layout files
Several .rds (r files) are included that specify the layout for the network figures
- layout1.rds -> layout7.rds: layout for networks with all available items
- layout16.rds -> layout76.rds: layout for networks with items from at least 6 waves
- mx.rds: maximum value for the network graphs
## Bootstrap files
The bootstrapping analyses can take a long time to run. They are completed using the code above. They are then saved into the folder "boots".
## Other files
- results.csv: Results from statistical tests saved in tidystats format.
- sessioninfo.txt: information about the computer environment
# Matrices
## Correlation Matrices
Correlation matrices can be used to recreate the network analyses in the paper. Names of matrices and the code used to create them are below.
- cor1.rds -> cor7.rds: estimated with "estimate networks.R"
- cor1.6.rds -> cor7.6.rds: estimated with "estimate networks at least 6.R"
- cor1.pkhi.rds -> cor7.pkhi.rds: estimated with "political knowledge networks.R"
- cor1.pklo.rds -> cor7.pklo.rds: estimated with "political knowledge networks.R"
- cor1.pkhi.6.rds -> cor7.pkhi.6.rds: estimated with "political knowledge networks at least 6.R"
- cor1.pklo.6.rds -> cor7.pklo.6.rds: estimated with "political knowledge networks at least 6.R"
- cor1.edhi.rds -> cor7.edhi.rds: estimated with "education networks.R"
- cor1.edlo.rds -> cor7.edlo.rds: estimated with "education networks.R"
- cor1.edhi.6.rds -> cor7.edhi.6.rds: estimated with "education networks at least 6.R"
- cor1.edlo.6.rds -> cor7.edlo.6.rds: estimated with "education networks at least 6.R"
- cor1.pkloqrt.rds -> cor7.pkloqrt.rds: estimated with "political knowledge networks quartiles.R"
- cor1.pkhiqrt.rds -> cor7.pkhiqrt.rds: estimated with "political knowledge networks quartiles.R"
## Weights matrices
To calculate the networks including behavior the raw data is necessary; a correlation matrix won't do. To help make this reproducible without direct access to the raw data, the weights matrices, used to construct the behavior networks are below.
- fit3.beh.rds -> fit4.beh.rds: estimated with "behavior network.R"
- fit3.beh6.rds -> fit4.beh6.rds: estimated with "behavior network at least 6.R"
- Remaining fit..rds : estimated with "behavior network with knowledge.R"
# Centrality Data
The centrality data used for the key ANOVAs and figures in the text are saved separately. These files are all "centrality....csv" files. The main results are from "centrality.csv".
# Shortest Path data
The shortest path data used for the key ANOVAs and figures in the text are saved separately. These files are all "shorts...csv" files. The main results are from "shorts.beh.csv".