#########################################
#########################################
setwd("~/workspace/lits/attributions/")
#########################################
load("~/workspace/lits/attributions/data/lits.RData")
df.model <- df[df$group_general != "Western Europe",]
This page includes everything related to modelling of the data. Click here for the final tables.
In this paper we have two depentend variables (DV) that are both binomial
Unilevel is used here for making distinction between multilevel analysis later. In the analysis of this chapter no contextual level variables are used.
I’m using the University of California’s resource R Data Analysis Examples: Logit Regression as a reference here.
unbisoc.1 <- glm(pov.log.social ~ incsour3, data = df.model, family = "binomial")
unbisoc.2 <- glm(pov.log.social ~ edu2, data = df.model, family = "binomial")
unbisoc.3 <- glm(pov.log.social ~ income2, data = df.model, family = "binomial")
unbisoc.4 <- glm(pov.log.social ~ past.diff, data = df.model, family = "binomial")
unbisoc.5 <- glm(pov.log.social ~ future.diff, data = df.model, family = "binomial")
unbisoc.6 <- glm(pov.log.social ~ crise, data = df.model, family = "binomial")
library(texreg)
## Version: 1.30.2
## Date: 2013-12-10
## Author: Philip Leifeld (University of Konstanz)
model.names = c("Transfer Dependency", "Education level",
"Perceived income","Income compared to past",
"Income compared to future","Effect of financial crises")
coef.names = c("(intercept)",
"Dependent vs. non-dependent",
"Low education vs. non-low education",
"Low income vs. high income",
"Income has worsened vs. has not",
"Income will worsen vs. will not",
"Has affected great or fair amount vs. has not")
htmlreg(list(unbisoc.1,unbisoc.2,
unbisoc.3,unbisoc.4,
unbisoc.5,unbisoc.6),
custom.model.names = model.names,
custom.coef.names = coef.names,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
caption="Simple logistic regression on social blame", caption.above=TRUE)
Transfer Dependency | Education level | Perceived income | Income compared to past | Income compared to future | Effect of financial crises | |
---|---|---|---|---|---|---|
(intercept) | -0.20*** | -0.53*** | -0.12*** | -0.11*** | 0.02 | -0.07*** |
(0.06) | (0.12) | (0.02) | (0.02) | (0.03) | (0.02) | |
Dependent vs. non-dependent | -0.16** | |||||
(0.06) | ||||||
Low education vs. non-low education | 0.17 | |||||
(0.12) | ||||||
Low income vs. high income | -0.41*** | |||||
(0.03) | ||||||
Income has worsened vs. has not | -0.39*** | |||||
(0.03) | ||||||
Income will worsen vs. will not | -0.49*** | |||||
(0.04) | ||||||
Has affected great or fair amount vs. has not | -0.46*** | |||||
(0.03) | ||||||
AIC | 31792.27 | 31857.28 | 31633.41 | 30682.55 | 24863.69 | 29145.44 |
BIC | 31808.40 | 31873.41 | 31649.54 | 30698.61 | 24879.34 | 29161.41 |
Log Likelihood | -15894.14 | -15926.64 | -15814.71 | -15339.27 | -12429.84 | -14570.72 |
Deviance | 31788.27 | 31853.28 | 31629.41 | 30678.55 | 24859.69 | 29141.44 |
Num. obs. | 23461 | 23504 | 23513 | 22777 | 18526 | 21614 |
***p < 0.001, **p < 0.01, *p < 0.05 |
-0.16
if we compare individual who is dependent on tranfers with individual who is not dependent-0.08
if we compare individual with low education with individual with no-low education-0.59
if we compare individual with low perceived income with individual with high perceived income-0.39
if we compare individual whose income has worsened during the financial crisis with individual whose income has not worsened-0.49
if we compare individual who is expecting his income to worsen during the next four years with individual expects his income to remain at the same level or to increase-0.46
if we compare individual who has suffered Great or fair amount from the financial crisis with individual who has suffered Little or not at allunbiind.1 <- glm(pov.log.individual ~ incsour3, data = df.model, family = "binomial")
unbiind.2 <- glm(pov.log.individual ~ edu2, data = df.model, family = "binomial")
unbiind.3 <- glm(pov.log.individual ~ income2, data = df.model, family = "binomial")
unbiind.4 <- glm(pov.log.individual ~ past.diff, data = df.model, family = "binomial")
unbiind.5 <- glm(pov.log.individual ~ future.diff, data = df.model, family = "binomial")
unbiind.6 <- glm(pov.log.individual ~ crise, data = df.model, family = "binomial")
library(texreg)
htmlreg(list(unbiind.1,unbiind.2,
unbiind.3,unbiind.4,
unbiind.5,unbiind.6),
custom.model.names = model.names,
custom.coef.names = coef.names,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
caption="Simple logistic regression on individual blame", caption.above=TRUE)
Transfer Dependency | Education level | Perceived income | Income compared to past | Income compared to future | Effect of financial crises | |
---|---|---|---|---|---|---|
(intercept) | -1.67*** | -1.20*** | -1.41*** | -1.41*** | -1.48*** | -1.52*** |
(0.08) | (0.14) | (0.03) | (0.03) | (0.04) | (0.03) | |
Dependent vs. non-dependent | 0.49*** | |||||
(0.08) | ||||||
Low education vs. non-low education | 0.00 | |||||
(0.14) | ||||||
Low income vs. high income | 0.35*** | |||||
(0.03) | ||||||
Income has worsened vs. has not | 0.32*** | |||||
(0.03) | ||||||
Income will worsen vs. will not | 0.40*** | |||||
(0.05) | ||||||
Has affected great or fair amount vs. has not | 0.53*** | |||||
(0.03) | ||||||
AIC | 25314.01 | 25393.10 | 25281.83 | 24576.83 | 20388.41 | 23070.37 |
BIC | 25330.13 | 25409.23 | 25297.96 | 24592.90 | 20404.06 | 23086.33 |
Log Likelihood | -12655.00 | -12694.55 | -12638.92 | -12286.42 | -10192.20 | -11533.19 |
Deviance | 25310.01 | 25389.10 | 25277.83 | 24572.83 | 20384.41 | 23066.37 |
Num. obs. | 23461 | 23504 | 23513 | 22777 | 18526 | 21614 |
***p < 0.001, **p < 0.01, *p < 0.05 |
0.49
if we compare individual who is dependent on tranfers to individual who is not dependent0.03
if we compare individual with low education with individual with no-low education. This is not statistically significant0.38
if we compare individual with low perceived income with individual with high perceived income0.32
if we compare individual whose income has worsened during the financial crisis with individual whose income has not worsened0.40
if we compare individual who is expecting his income to worsen during the next four years with individual expects his income to remain at the same level or to increase-0.53
if we compare individual who has suffered Great or fair amount from the financial crisis with individual who has suffered Little or not at allmulbisoc.1 <- glm(pov.log.social ~ incsour3, data = df.model, family = "binomial")
mulbisoc.2 <- glm(pov.log.social ~ incsour3 +
edu2, data = df.model, family = "binomial")
mulbisoc.3 <- glm(pov.log.social ~ incsour3 +
edu2 +
income2, data = df.model, family = "binomial")
mulbisoc.4 <- glm(pov.log.social ~ incsour3 +
edu2 +
income2 +
past.diff, data = df.model, family = "binomial")
mulbisoc.4 <- glm(pov.log.social ~ incsour3 +
edu2 +
income2 +
past.diff, data = df.model, family = "binomial")
mulbisoc.5 <- glm(pov.log.social ~ incsour3 +
edu2 +
income2 +
past.diff +
future.diff, data = df.model, family = "binomial")
mulbisoc.6 <- glm(pov.log.social ~ incsour3 +
edu2 +
income2 +
past.diff +
future.diff +
crise, data = df.model, family = "binomial")
library(texreg)
htmlreg(list(mulbisoc.1,mulbisoc.2,
mulbisoc.3,mulbisoc.4,
mulbisoc.5,mulbisoc.6),
custom.coef.names = coef.names,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
caption="Multiple logistic regression on social blame", caption.above=TRUE)
Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Model 6 | |
---|---|---|---|---|---|---|
(intercept) | -0.20*** | -0.38** | -0.28* | -0.04 | 0.42** | 0.50** |
(0.06) | (0.13) | (0.13) | (0.14) | (0.16) | (0.17) | |
Dependent vs. non-dependent | -0.16** | -0.16** | -0.13* | -0.11 | -0.17* | -0.14 |
(0.06) | (0.06) | (0.06) | (0.06) | (0.07) | (0.07) | |
Low education vs. non-low education | 0.18 | 0.29* | 0.23 | 0.12 | 0.12 | |
(0.12) | (0.12) | (0.12) | (0.14) | (0.15) | ||
Low income vs. high income | -0.42*** | -0.39*** | -0.40*** | -0.37*** | ||
(0.03) | (0.03) | (0.03) | (0.03) | |||
Income has worsened vs. has not | -0.32*** | -0.25*** | -0.17*** | |||
(0.03) | (0.03) | (0.03) | ||||
Income will worsen vs. will not | -0.44*** | -0.40*** | ||||
(0.04) | (0.04) | |||||
Has affected great or fair amount vs. has not | -0.36*** | |||||
(0.03) | ||||||
AIC | 31792.27 | 31779.53 | 31542.26 | 30413.96 | 24393.11 | 22663.10 |
BIC | 31808.40 | 31803.72 | 31574.51 | 30454.12 | 24440.02 | 22717.32 |
Log Likelihood | -15894.14 | -15886.76 | -15767.13 | -15201.98 | -12190.55 | -11324.55 |
Deviance | 31788.27 | 31773.53 | 31534.26 | 30403.96 | 24381.11 | 22649.10 |
Num. obs. | 23461 | 23452 | 23452 | 22721 | 18374 | 17089 |
***p < 0.001, **p < 0.01, *p < 0.05 |
0.49
if we compare individual who is dependent on tranfers to individual who is not dependent0.03
if we compare individual with low education with individual with no-low education. This is not statistically significant0.32
if we compare individual whose income has worsened during the financial crisis with individual whose income has not worsened0.40
if we compare individual who is expecting his income to worsen during the next four years with individual expects his income to remain at the same level or to increase-XXX
if we compare individual who has suffered Great or fair amount from the financial crisis with individual who has suffered Little or not at allmulbiind.1 <- glm(pov.log.individual ~ incsour3, data = df.model, family = "binomial")
mulbiind.2 <- glm(pov.log.individual ~ incsour3 +
edu2, data = df.model, family = "binomial")
mulbiind.3 <- glm(pov.log.individual ~ incsour3 +
edu2 +
income2, data = df.model, family = "binomial")
mulbiind.4 <- glm(pov.log.individual ~ incsour3 +
edu2 +
income2 +
past.diff, data = df.model, family = "binomial")
mulbiind.4 <- glm(pov.log.individual ~ incsour3 +
edu2 +
income2 +
past.diff, data = df.model, family = "binomial")
mulbiind.5 <- glm(pov.log.individual ~ incsour3 +
edu2 +
income2 +
past.diff +
future.diff, data = df.model, family = "binomial")
mulbiind.6 <- glm(pov.log.individual ~ incsour3 +
edu2 +
income2 +
past.diff +
future.diff +
crise, data = df.model, family = "binomial")
library(texreg)
htmlreg(list(mulbiind.1,mulbiind.2,
mulbiind.3,mulbiind.4,
mulbiind.5,mulbiind.6),
custom.coef.names = coef.names,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
caption="Multiple logistic regression on individual blame", caption.above=TRUE)
Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Model 6 | |
---|---|---|---|---|---|---|
(intercept) | -1.67*** | -1.66*** | -1.76*** | -1.93*** | -2.06*** | -2.21*** |
(0.08) | (0.16) | (0.16) | (0.16) | (0.19) | (0.20) | |
Dependent vs. non-dependent | 0.49*** | 0.49*** | 0.46*** | 0.45*** | 0.39*** | 0.33*** |
(0.08) | (0.08) | (0.08) | (0.08) | (0.09) | (0.09) | |
Low education vs. non-low education | 0.00 | -0.09 | -0.06 | -0.08 | -0.05 | |
(0.14) | (0.14) | (0.14) | (0.16) | (0.18) | ||
Low income vs. high income | 0.34*** | 0.30*** | 0.29*** | 0.26*** | ||
(0.03) | (0.03) | (0.04) | (0.04) | |||
Income has worsened vs. has not | 0.27*** | 0.21*** | 0.14*** | |||
(0.03) | (0.04) | (0.04) | ||||
Income will worsen vs. will not | 0.36*** | 0.33*** | ||||
(0.05) | (0.05) | |||||
Has affected great or fair amount vs. has not | 0.44*** | |||||
(0.04) | ||||||
AIC | 25314.01 | 25308.83 | 25198.07 | 24417.39 | 20104.00 | 18521.25 |
BIC | 25330.13 | 25333.01 | 25230.32 | 24457.54 | 20150.91 | 18575.47 |
Log Likelihood | -12655.00 | -12651.41 | -12595.03 | -12203.69 | -10046.00 | -9253.62 |
Deviance | 25310.01 | 25302.83 | 25190.07 | 24407.39 | 20092.00 | 18507.25 |
Num. obs. | 23461 | 23452 | 23452 | 22721 | 18374 | 17089 |
***p < 0.001, **p < 0.01, *p < 0.05 |
In multinomial setting we use variable poverty
as DV. Dont know
and not stated
values are exluded from the analysis and we are left with following four values:
Of the DV values we use Social Blame
as a reference category as it is distinctive category and allows me to make clear interpretations of the significance of the predictors. (source)
This follows the example from University of Toronto and Discrete-Choice Logit Models with R by Philip A. Viton (October 26, 2013)
library(mlogit)
## Loading required package: Formula
## Loading required package: maxLik
## Loading required package: miscTools
##
## Please cite the 'maxLik' package as:
## Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.
##
## If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
## https://r-forge.r-project.org/projects/maxlik/
dat.mlogit <- df.model[,c("poverty","edu2","incsour3","income2",
"past.diff","future.diff","crise")]
dat.mlogit <- mlogit.data(dat.mlogit, shape="wide", choice="poverty")
# ------- #
model.mlogit5 <- mlogit(poverty ~ 0 | incsour3 + edu2 +
past.diff + future.diff +
crise,
data = dat.mlogit,
reflevel ="Social Blame")
summary(model.mlogit5)
##
## Call:
## mlogit(formula = poverty ~ 0 | incsour3 + edu2 + past.diff +
## future.diff + crise, data = dat.mlogit, reflevel = "Social Blame",
## method = "nr", print.level = 0)
##
## Frequencies of alternatives:
## Social Blame Individual Blame Individual Fate Social Fate
## 0.450 0.262 0.110 0.178
##
## nr method
## 5 iterations, 0h:0m:2s
## g'(-H)^-1g = 3.84E-05
## successive function values within tolerance limits
##
## Coefficients :
## Estimate Std. Error t-value
## Individual Blame:(intercept) -1.777836 0.220002 -8.08
## Individual Fate:(intercept) -1.946130 0.265878 -7.32
## Social Fate:(intercept) -1.764688 0.269663 -6.54
## Individual Blame:incsour3notDependent 0.372283 0.099007 3.76
## Individual Fate:incsour3notDependent 0.011231 0.120737 0.09
## Social Fate:incsour3notDependent 0.027272 0.099785 0.27
## Individual Blame:edu2higher 0.000904 0.193010 0.00
## Individual Fate:edu2higher -0.349059 0.230661 -1.51
## Social Fate:edu2higher 0.365868 0.248106 1.47
## Individual Blame:past.diffsame or better 0.270862 0.043845 6.18
## Individual Fate:past.diffsame or better 0.228006 0.059970 3.80
## Social Fate:past.diffsame or better 0.159721 0.048618 3.29
## Individual Blame:future.diffsame or better 0.450845 0.053514 8.42
## Individual Fate:future.diffsame or better 0.524579 0.076319 6.87
## Social Fate:future.diffsame or better 0.269378 0.057731 4.67
## Individual Blame:criseLittle or not at all 0.587613 0.041704 14.09
## Individual Fate:criseLittle or not at all 0.518815 0.057026 9.10
## Social Fate:criseLittle or not at all 0.258517 0.046222 5.59
## Pr(>|t|)
## Individual Blame:(intercept) 6.7e-16 ***
## Individual Fate:(intercept) 2.5e-13 ***
## Social Fate:(intercept) 6.0e-11 ***
## Individual Blame:incsour3notDependent 0.00017 ***
## Individual Fate:incsour3notDependent 0.92588
## Social Fate:incsour3notDependent 0.78462
## Individual Blame:edu2higher 0.99626
## Individual Fate:edu2higher 0.13020
## Social Fate:edu2higher 0.14031
## Individual Blame:past.diffsame or better 6.5e-10 ***
## Individual Fate:past.diffsame or better 0.00014 ***
## Social Fate:past.diffsame or better 0.00102 **
## Individual Blame:future.diffsame or better < 2e-16 ***
## Individual Fate:future.diffsame or better 6.3e-12 ***
## Social Fate:future.diffsame or better 3.1e-06 ***
## Individual Blame:criseLittle or not at all < 2e-16 ***
## Individual Fate:criseLittle or not at all < 2e-16 ***
## Social Fate:criseLittle or not at all 2.2e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Log-Likelihood: -19500
## McFadden R^2: 0.0137
## Likelihood ratio test : chisq = 543 (p.value = <2e-16)
Can be modelled in R in Bayesian manner using either ChoiceModelR and Zelig.
Marco Steenbergen discusses the stat theory and imlementation in Stata in this video
library(lme4)
## Loading required package: lattice
## Loading required package: Matrix
df.model$group_balinCis[df.model$cntry %in% c('Czech Republic',
'Hungary','Bulgaria',
'Poland','Slovakia',
'Slovenia','Romania')] <- 'CEE'
df.model$group_balinCis[df.model$cntry %in% c('Armenia','Azerbaijan',
'Belarus','Georgia',
'Kazakhstan','Kyrgyzstan',
'Moldova','Tajikistan',
'Ukraine','Uzbekistan','Russia',
'Estonia','Latvia','Lithuania')] <- 'CIS'
df.model$group_balinCis <- factor(df.model$group_balinCis, levels=c("CEE","CIS"))
bisoc.1 <- glmer(pov.log.social ~ incsour3+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.2 <- glmer(pov.log.social ~ edu2+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.3 <- glmer(pov.log.social ~ income2+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.4 <- glmer(pov.log.social ~ past.diff+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.5 <- glmer(pov.log.social ~ future.diff+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.6 <- glmer(pov.log.social ~ crise+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.8 <- glmer(pov.log.social ~ undp_hdi+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.9 <- glmer(pov.log.social ~ gdpChange+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.10 <- glmer(pov.log.social ~ wbgi_vae+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.11 <- glmer(pov.log.social ~ group_analysis+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.12 <- glmer(pov.log.social ~ group_balinCis+(1|cntry),
family = binomial(logit), data = df.model)
bisoc.13 <- glmer(pov.log.social ~ perGini+(1|cntry),
family = binomial(logit), data = df.model)
coef.names.multi = c("(intercept)",
"Dependent","Low education",
"Low income","Income has worsened",
"Income will worsen","Has affected great or fair amount",
"Human Development Index",
"Change in GDP between 2007 to 2010",
"Good governance","Cgroup","CgroupMod",
"Perceived Gini")
library(texreg)
htmlreg(list(bisoc.1,bisoc.2,
bisoc.3,bisoc.4,
bisoc.5,bisoc.6,
bisoc.8,
bisoc.9,bisoc.10,
bisoc.11,bisoc.12,
bisoc.13),
#custom.coef.names = coef.names.multi,
naive = TRUE,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
include.pvalues=TRUE,
caption="Bivariate social blame", caption.above=TRUE)
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Model 6 | Model 7 | Model 8 | Model 9 | Model 10 | Model 11 | Model 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
(Intercept) | -0.19 | -0.55** | -0.16 | -0.23 | -0.12 | -0.14 | -2.34* | -0.17 | -0.36*** | -0.26 | -0.34 | -2.01** |
(0.13) | (0.17) | (0.12) | (0.12) | (0.12) | (0.11) | (1.06) | (0.11) | (0.11) | (0.17) | (0.20) | (0.63) | |
incsour3notDependent | -0.21*** | |||||||||||
(0.06) | ||||||||||||
edu2higher | 0.16 | |||||||||||
(0.12) | ||||||||||||
income2High | -0.39*** | |||||||||||
(0.03) | ||||||||||||
past.diffsame or better | -0.25*** | |||||||||||
(0.03) | ||||||||||||
future.diffsame or better | -0.37*** | |||||||||||
(0.04) | ||||||||||||
criseLittle or not at all | -0.42*** | |||||||||||
(0.03) | ||||||||||||
undp_hdi | 2.59 | |||||||||||
(1.41) | ||||||||||||
gdpChange | -0.01*** | |||||||||||
(0.00) | ||||||||||||
wbgi_vae | 0.23* | |||||||||||
(0.11) | ||||||||||||
group_analysisCIS | -0.24 | |||||||||||
(0.23) | ||||||||||||
group_balinCisCIS | -0.07 | |||||||||||
(0.25) | ||||||||||||
perGini | 0.08** | |||||||||||
(0.03) | ||||||||||||
AIC | 30262.21 | 30331.32 | 30147.92 | 29305.05 | 23667.34 | 27981.03 | 30342.24 | 30334.30 | 30340.93 | 30344.31 | 30345.33 | 30339.48 |
BIC | 30286.40 | 30355.52 | 30172.11 | 29329.15 | 23690.82 | 28004.97 | 30366.44 | 30358.50 | 30365.13 | 30368.50 | 30369.52 | 30363.68 |
Log Likelihood | -15128.11 | -15162.66 | -15070.96 | -14649.53 | -11830.67 | -13987.51 | -15168.12 | -15164.15 | -15167.47 | -15169.15 | -15169.66 | -15166.74 |
Deviance | 30256.21 | 30325.32 | 30141.92 | 29299.05 | 23661.34 | 27975.03 | 30336.24 | 30328.30 | 30334.93 | 30338.31 | 30339.33 | 30333.48 |
Num. obs. | 23461 | 23504 | 23513 | 22777 | 18526 | 21614 | 23513 | 23513 | 23513 | 23513 | 23513 | 23513 |
Num. groups: cntry | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 |
Variance: cntry.(Intercept) | 0.29 | 0.29 | 0.29 | 0.28 | 0.29 | 0.26 | 0.25 | 0.17 | 0.23 | 0.27 | 0.29 | 0.22 |
Variance: Residual | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 |
***p < 0.001, **p < 0.01, *p < 0.05 |
biind.1 <- glmer(pov.log.individual ~ incsour3+(1|cntry),
family = binomial(logit), data = df.model)
biind.2 <- glmer(pov.log.individual ~ edu2+(1|cntry),
family = binomial(logit), data = df.model)
biind.3 <- glmer(pov.log.individual ~ income2+(1|cntry),
family = binomial(logit), data = df.model)
biind.4 <- glmer(pov.log.individual ~ past.diff+(1|cntry),
family = binomial(logit), data = df.model)
biind.5 <- glmer(pov.log.individual ~ future.diff+(1|cntry),
family = binomial(logit), data = df.model)
biind.6 <- glmer(pov.log.individual ~ crise+(1|cntry),
family = binomial(logit), data = df.model)
biind.8 <- glmer(pov.log.individual ~ undp_hdi+(1|cntry),
family = binomial(logit), data = df.model)
biind.9 <- glmer(pov.log.individual ~ gdpChange+(1|cntry),
family = binomial(logit), data = df.model)
biind.10 <- glmer(pov.log.individual ~ wbgi_vae+(1|cntry),
family = binomial(logit), data = df.model)
biind.11 <- glmer(pov.log.individual ~ group_analysis+(1|cntry),
family = binomial(logit), data = df.model)
biind.12 <- glmer(pov.log.individual ~ group_balinCis+(1|cntry),
family = binomial(logit), data = df.model)
biind.13 <- glmer(pov.log.individual ~ perGini+(1|cntry),
family = binomial(logit), data = df.model)
library(texreg)
htmlreg(list(biind.1,biind.2,
biind.3,biind.4,
biind.5,biind.6,
biind.8,
biind.9,biind.10,
biind.11,biind.12,
biind.13),
#custom.coef.names = coef.names.multi,
naive = TRUE,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
use.packages=FALSE,
include.pvalues=TRUE,
caption="Bivariate individual blame",
caption.above=TRUE)
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Model 6 | Model 7 | Model 8 | Model 9 | Model 10 | Model 11 | Model 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
(Intercept) | -1.72*** | -1.23*** | -1.47*** | -1.40*** | -1.44*** | -1.52*** | 0.39 | -1.40*** | -1.26*** | -1.33*** | -1.28*** | -0.42 |
(0.11) | (0.16) | (0.08) | (0.08) | (0.08) | (0.08) | (0.65) | (0.07) | (0.07) | (0.11) | (0.13) | (0.43) | |
incsour3notDependent | 0.49*** | |||||||||||
(0.08) | ||||||||||||
edu2higher | -0.02 | |||||||||||
(0.14) | ||||||||||||
income2High | 0.36*** | |||||||||||
(0.03) | ||||||||||||
past.diffsame or better | 0.24*** | |||||||||||
(0.04) | ||||||||||||
future.diffsame or better | 0.31*** | |||||||||||
(0.05) | ||||||||||||
criseLittle or not at all | 0.50*** | |||||||||||
(0.04) | ||||||||||||
undp_hdi | -2.18* | |||||||||||
(0.86) | ||||||||||||
gdpChange | 0.01*** | |||||||||||
(0.00) | ||||||||||||
wbgi_vae | -0.16* | |||||||||||
(0.07) | ||||||||||||
group_analysisCIS | 0.16 | |||||||||||
(0.15) | ||||||||||||
group_balinCisCIS | 0.04 | |||||||||||
(0.16) | ||||||||||||
perGini | -0.04* | |||||||||||
(0.02) | ||||||||||||
AIC | 24816.34 | 24895.46 | 24777.07 | 24131.55 | 20052.68 | 22693.65 | 24896.35 | 24888.58 | 24897.13 | 24900.86 | 24901.94 | 24898.49 |
BIC | 24840.53 | 24919.65 | 24801.27 | 24155.66 | 20076.16 | 22717.59 | 24920.55 | 24912.78 | 24921.32 | 24925.06 | 24926.14 | 24922.68 |
Log Likelihood | -12405.17 | -12444.73 | -12385.54 | -12062.78 | -10023.34 | -11343.82 | -12445.18 | -12441.29 | -12445.56 | -12447.43 | -12447.97 | -12446.24 |
Deviance | 24810.34 | 24889.46 | 24771.07 | 24125.55 | 20046.68 | 22687.65 | 24890.35 | 24882.58 | 24891.13 | 24894.86 | 24895.94 | 24892.49 |
Num. obs. | 23461 | 23504 | 23513 | 22777 | 18526 | 21614 | 23513 | 23513 | 23513 | 23513 | 23513 | 23513 |
Num. groups: cntry | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 |
Variance: cntry.(Intercept) | 0.12 | 0.12 | 0.12 | 0.11 | 0.10 | 0.11 | 0.09 | 0.06 | 0.09 | 0.11 | 0.12 | 0.10 |
Variance: Residual | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 |
***p < 0.001, **p < 0.01, *p < 0.05 |
library(lme4)
soc.0 <- glmer(pov.log.social ~ (1|cntry),
family = binomial(logit),
data = df.model)
soc.1 <- glmer(pov.log.social ~ incsour3+edu2+income2+
past.diff+future.diff+crise+(1|cntry),
family = binomial(logit),
data = df.model)
soc.2 <- glmer(pov.log.social ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+(1|cntry),
family = binomial(logit),
data = df.model)
soc.3 <- glmer(pov.log.social ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+gdpChange+(1|cntry),
family = binomial(logit),
data = df.model)
soc.4 <- glmer(pov.log.social ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+gdpChange+wbgi_vae+(1|cntry),
family = binomial(logit),
data = df.model)
soc.Cont <- glmer(pov.log.social ~ undp_hdi+gdpChange+
wbgi_vae+(1|cntry),
family = binomial(logit),
data = df.model)
coef.names.multi = c("(intercept)",
"Dependent","Low education",
"Low income","Income has worsened",
"Income will worsen","Has affected great or fair amount",
"Human Deveplopment Index",
"Change in GDP between 2007 to 2010",
"Good governance")
model.names.multi = c("Empty",
"Only individual",
"HDI added",
"GDP change added",
"Good governance added")
htmlreg(list(soc.0,
soc.1,
soc.2,
soc.3,
soc.4),
custom.model.names = model.names.multi,
custom.coef.names = coef.names.multi,
naive = TRUE,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
include.pvalues=TRUE,
caption="Logistic multilevel random intercept model for social blame type of explanation",
caption.above=TRUE)
ind.0 <- glmer(pov.log.individual ~ (1|cntry),
family = binomial(logit),
data = df.model)
ind.1 <- glmer(pov.log.individual ~ incsour3+edu2+income2+
past.diff+future.diff+crise+(1|cntry),
family = binomial(logit),
data = df.model)
ind.2 <- glmer(pov.log.individual ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+(1|cntry),
family = binomial(logit),
data = df.model)
ind.3 <- glmer(pov.log.individual ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+gdpChange+(1|cntry),
family = binomial(logit),
data = df.model)
ind.4 <- glmer(pov.log.individual ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+gdpChange+wbgi_vae+(1|cntry),
family = binomial(logit),
data = df.model)
ind.Cont <- glmer(pov.log.individual ~ undp_hdi+gdpChange+
wbgi_vae+(1|cntry),
family = binomial(logit),
data = df.model)
htmlreg(list(ind.0,
ind.1,
ind.2,
ind.3,
ind.4),
custom.model.names = model.names.multi,
custom.coef.names = coef.names.multi,
naive = TRUE,
ci.test = NULL,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
include.pvalues=TRUE,
caption="Logistic multilevel random intercept model for individual blame type of explanation",
caption.above=TRUE)
df.model$pov.log.socVsInc[df.model$poverty == "Social Blame"] <- 1
df.model$pov.log.socVsInc[df.model$poverty == "Individual Blame"] <- 0
socVsInc <- glmer(pov.log.socVsInc ~ incsour3+edu2+income2+
past.diff+future.diff+crise+
undp_hdi+gdpChange+wbgi_vae+(1|cntry),
family = binomial(logit),
data = df.model)
save(ind.0,ind.1,ind.2,ind.3,ind.4,ind.Cont,
soc.0,soc.1,soc.2,soc.3,soc.4,soc.Cont,
socVsInc, file="data/finalModels.RData")
library(texreg)
#load("data/finalModels.RData")
coef.names.multi = c("(intercept)",
"Dependent","Low education",
"Low income","Income has worsened",
"Income will worsen","Has affected great or fair amount",
"Human Deveplopment Index",
"Change in GDP between 2007 to 2010",
"Voice and Accountability")
model.names.multi = c("Empty",
"Only individual",
"HDI added",
"GDP change added",
"Voice and Accountability added")
model.names.multi.A = c("SB empty",
"SB individual",
"SB contextual",
"SB all",
"IB empty",
"IB individual",
"IB contextual",
"IB all",
"SB vs. IB")
htmlreg(list(soc.0,soc.1,soc.Cont,soc.4,
ind.0,ind.1,ind.Cont,ind.4,socVsInc),
custom.model.names = model.names.multi.A,
custom.coef.names = coef.names.multi,
naive=TRUE,
inline.css = TRUE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
include.pvalues=TRUE,
caption="Logistic multilevel random intercept model for social and individual blame type of explanation",
caption.above=TRUE)
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
## confint.merMod method not found. Using naive p values instead.
SB empty | SB individual | SB contextual | SB all | IB empty | IB individual | IB contextual | IB all | SB vs. IB | |
---|---|---|---|---|---|---|---|---|---|
(intercept) | -0.39** | 0.36 | 0.38 | 0.88 | -1.25*** | -2.19*** | -0.85 | -1.24 | 1.61 |
(0.12) | (0.21) | (1.51) | (1.48) | (0.08) | (0.22) | (0.90) | (0.86) | (1.34) | |
Dependent | -0.20** | -0.20** | 0.37*** | 0.37*** | -0.43*** | ||||
(0.07) | (0.07) | (0.09) | (0.09) | (0.10) | |||||
Low education | 0.11 | 0.11 | -0.04 | -0.04 | -0.01 | ||||
(0.16) | (0.16) | (0.18) | (0.18) | (0.20) | |||||
Low income | -0.36*** | -0.37*** | 0.28*** | 0.28*** | -0.43*** | ||||
(0.03) | (0.03) | (0.04) | (0.04) | (0.04) | |||||
Income has worsened | -0.06 | -0.06 | 0.08 | 0.07 | -0.10* | ||||
(0.04) | (0.04) | (0.04) | (0.04) | (0.05) | |||||
Income will worsen | -0.32*** | -0.32*** | 0.27*** | 0.26*** | -0.41*** | ||||
(0.04) | (0.04) | (0.05) | (0.05) | (0.06) | |||||
Has affected great or fair amount | -0.32*** | -0.32*** | 0.44*** | 0.44*** | -0.53*** | ||||
(0.04) | (0.04) | (0.04) | (0.04) | (0.05) | |||||
Human Deveplopment Index | -0.65 | -0.36 | -0.77 | -1.45 | 0.73 | ||||
(1.96) | (1.91) | (1.17) | (1.09) | (1.72) | |||||
Change in GDP between 2007 to 2010 | -0.02** | -0.02** | 0.01*** | 0.01** | -0.02*** | ||||
(0.01) | (0.01) | (0.00) | (0.00) | (0.01) | |||||
Voice and Accountability | -0.08 | -0.08 | 0.13 | 0.13 | -0.14 | ||||
(0.18) | (0.17) | (0.11) | (0.10) | (0.16) | |||||
AIC | 30343.40 | 21780.91 | 30337.63 | 21776.53 | 24900.01 | 18249.54 | 24891.15 | 18239.74 | 13565.27 |
BIC | 30359.53 | 21842.88 | 30377.96 | 21861.73 | 24916.15 | 18311.51 | 24931.47 | 18324.95 | 13645.80 |
Log Likelihood | -15169.70 | -10882.45 | -15163.82 | -10877.26 | -12448.01 | -9116.77 | -12440.57 | -9108.87 | -6771.63 |
Deviance | 30339.40 | 21764.91 | 30327.63 | 21754.53 | 24896.01 | 18233.54 | 24881.15 | 18217.74 | 13543.27 |
Num. obs. | 23513 | 17089 | 23513 | 17089 | 23513 | 17089 | 23513 | 17089 | 11169 |
Num. groups: cntry | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 | 21 |
Variance: cntry.(Intercept) | 0.29 | 0.26 | 0.16 | 0.15 | 0.12 | 0.10 | 0.05 | 0.04 | 0.12 |
Variance: Residual | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 |
***p < 0.001, **p < 0.01, *p < 0.05 |
coef.names.multi = c("(intercept)",
"Dependent","Low education",
"Low income","Income has worsened",
"Income will worsen","Has affected great or fair amount",
"Human Development Index",
"Change in GDP between 2007 to 2010",
"Good governance")
model.names.multi.2 = c("Social blame vs. not",
"Individual blame vs. not",
"Social blame vs. Individual blame")
library(texreg)
htmlreg(list(soc.4,ind.4,socVsInc),
naive = TRUE,
custom.model.names = model.names.multi.2,
custom.coef.names = coef.names.multi,
inline.css = FALSE,
doctype = FALSE,
html.tag = FALSE,
head.tag = FALSE,
body.tag = FALSE,
include.pvalues=TRUE,
caption="Logistic multilevel random intercept model for social and individual blame type of explanation",
caption.above=TRUE)