-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfigure3.R
16 lines (14 loc) · 919 Bytes
/
figure3.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#-------------------------------------------------------
# Figure 3: Predicted probabilities for Qur'an reading
#-------------------------------------------------------
# Build range for varied parameter
sample.range <- min(barometer$quran, na.rm=T):max(barometer$quran, na.rm=T)
# Build new data for prediction
X <- cbind(sample.range, my.mode(barometer$prime.minister), my.mode(barometer$citizen.influence), my.mode(barometer$maintain.order), my.mode(barometer$education), my.mode(barometer$age), my.mode(barometer$family.econ))
# Plot simulated probabilities
fig3 <- logit.spaghetti(all.countries.logit, cbind(1, X), y.range=sample.range,
y.plot.label="Probability of thinking autocracy is bad\n",
x.plot.label="\nFrequency of Qur'an reading",
x.labels=c("Everyday", "Several times a week", "Sometimes", "Rarely", "I don't read it"),
runs=250)
fig3