This is fact-check analysis of Turkish politicians. The data has two sources: The first source is www.dogrulukpayi.com. The second source is compiled by the author during a LAP project of Atilim University.
rm(list=ls(all=TRUE))
setwd("D:/emre/SkyDrive/makale/FactCheck")
library(lessR)
##
## lessR 3.5.0 feedback: gerbing@pdx.edu web: lessRstats.com
## -------------------------------------------------------------------
## 1. Read a text, Excel, SPSS, SAS or R data file from your computer
## into the mydata data table, enter: mydata <- Read()
## 2. For a list of help topics and functions, enter: Help()
## 3. Use theme function for global settings, Ex: theme(colors="gray")
library(foreign)
library(nnet)
library(effects)
library(car)
##
## Attaching package: 'car'
## The following object is masked from 'package:effects':
##
## Prestige
## The following objects are masked from 'package:lessR':
##
## bc, Recode, sp
library(reshape)
library(sjPlot)
## Visit http://strengejacke.de/sjPlot for package-vignettes.
library(plyr)
##
## Attaching package: 'plyr'
## The following objects are masked from 'package:reshape':
##
## rename, round_any
library(pander)
mydata <- read.csv("combinedR.csv")
mydata$Tone <- NULL
mydata$b.fact <- mydata$Scale3
#0 False, 1 True
mydata$b.fact[mydata$b.fact==2] <- NA
mydata$b.fact[mydata$b.fact==3] <- 0
mydata$b.fact <- as.factor(mydata$b.fact)
levels(mydata$b.fact)[levels(mydata$b.fact)=="0"] <- "False"
levels(mydata$b.fact)[levels(mydata$b.fact)=="1"] <- "True"
mydata$Party[mydata$Party == 1] <- "AKP"
mydata$Party[mydata$Party == 2] <- "CHP"
mydata$Party[mydata$Party == 3] <- "MHP"
mydata$Party[mydata$Party == 4] <- "HDP"
mydata$Party[mydata$Party == 5] <- "Others"
mydata$f.party <- as.factor(mydata$Party)
mydata$f.party <- relevel(mydata$f.party, ref = "AKP")
mydata$f.topic <- NA
mydata$f.topic[mydata$Topic=="Ekonomi"] <- 1
mydata$f.topic[mydata$Topic=="Mali Politikalar"] <- 1
mydata$f.topic[mydata$Topic=="Sanayi, Ticaret ve Finans"] <- 1
mydata$f.topic<-recode(mydata$f.topic,"NA=0")
mydata$f.topic[mydata$f.topic==1] <- "Economy"
mydata$f.topic[mydata$f.topic==0] <- "Other Issues"
mydata$f.topic <- as.factor(mydata$f.topic)
Basic Plots
sjp.frq(mydata$b.fact)
sjp.xtab(mydata$f.topic, mydata$b.fact, margin = "row", bar.pos = "stack", coord.flip = TRUE,
show.n = FALSE, show.prc = TRUE, axis.titles = "Message Medium", geom.colors = c("red", "green"))
sjp.xtab(mydata$f.party, mydata$b.fact, margin = "row", bar.pos = "stack", coord.flip = TRUE,
show.n = FALSE, show.prc = TRUE, axis.titles = "Message Sender Party", geom.colors = c("red", "green"))
The Model
mod <- glm(b.fact ~ f.topic + f.party, data=mydata, family="binomial")
modt <- sjt.glm(mod)
## Waiting for profiling to be done...
pander(modt)
## Warning in pander.default(modt): No pander.method for "sjTable", reverting
## to default.No pander.method for "sjtglm", reverting to default.
| b.fact | ||||
| OR | CI | p | ||
| (Intercept) | 1.28 | 0.82 – 2.01 | .284 | |
| f.topic (Other Issues) | 1.88 | 1.20 – 2.92 | .005 | |
| f.party | ||||
| CHP | 1.69 | 1.10 – 2.61 | .018 | |
| HDP | 3.50 | 1.32 – 12.07 | .023 | |
| MHP | 1.96 | 1.15 – 3.47 | .017 | |
| Others | 0.81 | 0.45 – 1.49 | .493 | |
| Observations | 667 | |||
| b.fact | ||||
| OR | CI | p | ||
| (Intercept) | 1.28 | 0.82 – 2.01 | .284 | |
| f.topic (Other Issues) | 1.88 | 1.20 – 2.92 | .005 | |
| f.party | ||||
| CHP | 1.69 | 1.10 – 2.61 | .018 | |
| HDP | 3.50 | 1.32 – 12.07 | .023 | |
| MHP | 1.96 | 1.15 – 3.47 | .017 | |
| Others | 0.81 | 0.45 – 1.49 | .493 | |
| Observations | 667 | |||
| b.fact | ||||
| OR | CI | p | ||
| (Intercept) | 1.28 | 0.82 – 2.01 | .284 | |
| f.topic (Other Issues) | 1.88 | 1.20 – 2.92 | .005 | |
| f.party | ||||
| CHP | 1.69 | 1.10 – 2.61 | .018 | |
| HDP | 3.50 | 1.32 – 12.07 | .023 | |
| MHP | 1.96 | 1.15 – 3.47 | .017 | |
| Others | 0.81 | 0.45 – 1.49 | .493 | |
| Observations | 667 | |||
data:
| coef.name | estimate1 | ci.lo1 | ci.hi1 | p-value1 | se1 |
|---|---|---|---|---|---|
| (Intercept) | 1.28 | 0.82 | 2.01 | .284 | 0.23 |
| f.topicOther Issues | 1.88 | 1.20 | 2.92 | .005 | 0.23 |
| f.partyCHP | 1.69 | 1.10 | 2.61 | .018 | 0.22 |
| f.partyHDP | 3.50 | 1.32 | 12.07 | .023 | 0.55 |
| f.partyMHP | 1.96 | 1.15 | 3.47 | .017 | 0.28 |
| f.partyOthers | 0.81 | 0.45 | 1.49 | .493 | 0.31 |
sjp.glm(mod)
## Waiting for profiling to be done...