You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

513 lines
20 KiB

xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.text = element_text(size = 18))
g_perday
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 18))
g_perday
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 12))
g_perday
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 13))
g_perday
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14, face="plain")) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 13))
g_perday
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 13))
g_perday
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie") +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 13))
g_entrop
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie")# +
# theme(legend.title = element_text(size=14)) +
# theme(legend.text = element_text(size=12)) +
# theme(axis.title = element_text(size = 13))
g_entrop
detach("package:ggplot2", unload=TRUE)
library("ggplot2", lib.loc="/usr/lib/R/site-library")
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie")# +
# theme(legend.title = element_text(size=14)) +
# theme(legend.text = element_text(size=12)) +
# theme(axis.title = element_text(size = 13))
g_entrop
theme()
require(stringr)
require(reshape2)
require(ggplot2)
require(vars)
theme()
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie")# +
# theme(legend.title = element_text(size=14)) +
# theme(legend.text = element_text(size=12)) +
# theme(axis.title = element_text(size = 13))
g_entrop
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie")
g_entrop
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation"))
g_perday
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie")
g_entrop
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1)
g_entrop
stats_entropy <- data.frame(date=drange)
stats_entropy$entropy <- issues_i$entropy
stats_entropy <- melt(stats_entropy, id="date")
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie")
g_entrop
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie") +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 13))
g_entrop
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie") +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 14))
g_entrop
g_perday <- ggplot(data = stats_melt, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line()+
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Tweets pro Tag") +
scale_colour_discrete(name = "Tweets", labels = c("Gesamt", "Allgemein", "Sensation")) +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 14))
g_perday
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie") +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 14))
g_entrop
acc_parties <- data.frame(party = c("cducsu", "spd", "linke", "gruene"))
acc_parties$btw13 <- c(49.3, 30.6, 10.1, 10.0) # seats of party / 631 seats
acc_parties$twitter <- 0
for(p in 1:nrow(acc_parties)) {
acc_parties$twitter[p] <- round(nrow(acc_df[acc_df$party == as.character(acc_parties$party[p]), ]) / 280 * 100)
}
require(jsonlite)
require(stringr)
require(devtools)
require(RTwitterAPI)
acc_df <- read.csv("MdB-twitter.csv")
delrow <- NULL
for(r in 1:nrow(acc_df)) {
acc <- as.character(acc_df$twitter_acc[r])
if(!nzchar(acc)) {
delrow <- c(delrow, r)
}
}
acc_df <- acc_df[-delrow, ]
rm(delrow, r, acc)
acc_df$row.names <- NULL
row.names(acc_df) <- NULL
acc_parties <- data.frame(party = c("cducsu", "spd", "linke", "gruene"))
acc_parties$btw13 <- c(49.3, 30.6, 10.1, 10.0) # seats of party / 631 seats
acc_parties$twitter <- 0
for(p in 1:nrow(acc_parties)) {
acc_parties$twitter[p] <- round(nrow(acc_df[acc_df$party == as.character(acc_parties$party[p]), ]) / 280 * 100)
}
pie(acc_parties$btw13, col=c("black", "red", "purple", "green"), labels = c("CDU/CSU", "SPD", "Die LINKE", "Bündnis 90/Grüne"), clockwise = T,
main = "Seats of parties in the parliament")
pie(acc_parties$twitter, col=c("black", "red", "purple", "green"), labels = c("CDU/CSU", "SPD", "Die LINKE", "Bündnis 90/Grüne"), clockwise = T,
main = "Percentage of parties' MdBs of all Twitter accounts")
pie(acc_parties$btw13, col=c("black", "red", "purple", "green"), labels = c("CDU/CSU", "SPD", "Die LINKE", "Bündnis 90/Grüne"), clockwise = T)
pie(acc_parties$twitter, col=c("black", "red", "purple", "green"), labels = c("CDU/CSU", "SPD", "Die LINKE", "Bündnis 90/Grüne"), clockwise = T)
View(acc_parties)
pie(acc_parties$btw13, col=c("black", "red", "purple", "green"),
labels = c("CDU/CSU (49.3%)", "SPD", "Die LINKE", "Bündnis 90/Grüne"), clockwise = T)
pie(acc_parties$btw13, col=c("black", "red", "purple", "green"),
labels = c("CDU/CSU (49,3%)", "SPD (30,6%)", "Die LINKE (10,1%)", "Bündnis 90/Grüne(10.0%)"),
clockwise = T)
acc_parties <- data.frame(party = c("cducsu", "spd", "gruene", "linke"))
acc_parties$btw13 <- c(49.3, 30.6, 10.0, 10.1) # seats of party / 631 seats
acc_parties$twitter <- 0
for(p in 1:nrow(acc_parties)) {
acc_parties$twitter[p] <- round(nrow(acc_df[acc_df$party == as.character(acc_parties$party[p]), ]) / 280 * 100)
}
pie(acc_parties$btw13, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (49,3%)", "SPD (30,6%)", "Bündnis 90/Grüne(10.0%)", "Die LINKE (10,1%)"),
clockwise = T)
pie(acc_parties$btw13, col=c("black", "red", "green", "purple"),
pie(acc_parties$btw13, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (49,3%)", "SPD (30,6%)", "Bündnis 90/Grüne(10,0%)", "Die LINKE (10,1%)"),
clockwise = T)
pie(acc_parties$btw13, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (49,3%)", "SPD (30,6%)", "Bündnis 90/Grüne(10,0%)", "Die LINKE (10,1%)"),
clockwise = T)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 90)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 180)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 270)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 360)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 20)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 20)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T, init.angle = 90)
pie(acc_parties$btw13, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (49,3%)", "SPD (30,6%)", "Bündnis 90/Grüne(10,0%)", "Die LINKE (10,1%)"),
clockwise = T)
pie(acc_parties$twitter, col=c("black", "red", "green", "purple"),
labels = c("CDU/CSU (36%)", "SPD (30%)", "Bündnis 90/Grüne(19%)", "Die LINKE (15%)"),
clockwise = T)
2359 / 200 * 100
issues_ts <- as.ts(issues[,2:44])
VARselect(issues_ts, lag.max = 5, type = "both")
vIssues <- VAR(issues_ts, p=5, type="both")
vIssues <- VAR(issues_ts, p=1, type="both")
issues_ts <- as.ts(issues)
VARselect(issues[2:44], lag.max = 8, type = "both")
summary(ur.df(issues_ts[, 2], type ="none", lags=1))
VARselect(issues_ts, lag.max = 5, type = "both")
issues_ts <- as.ts(issues[,2:44])
VARselect(issues_ts, lag.max = 5, type = "both")
VARselect(issues_ts, lag.max = 5, type = "both")
VARselect(issues_ts, lag.max = 5, type = "both")
VARselect(issues_ts, lag.max = 5, type = "both")
VARselect(issues_ts, lag.max = 5, type = "both")
VARselect(issues_ts, lag.max = 5, type = "both")
VARselect(issues_ts, lag.max = 5, type = "both")
summary(ur.df(issues_ts[, 2], type ="none", lags=1))
ur.df(issues_ts[, 2], type ="none", lags=1)
head(issues_ts)
issues_ts$i1.macro
issues_ts[, "i1.macro"]
summary(ur.df(issues_ts[, "i1.macro"], type ="none", lags=1))
ncol(issues_ts)
for(i in 2:ncol(issues_ts)) {
summary(ur.df(issues_ts[, i], type ="none", lags=1))
}
cat(summary(ur.df(issues_ts[, "i1.macro"], type ="none", lags=1)))
paste(summary(ur.df(issues_ts[, "i1.macro"], type ="none", lags=1)))
i
summary(ur.df(issues_ts[, i], type ="none", lags=1))
summary(ur.df(issues_ts[, 1], type ="none", lags=1))
summary(ur.df(issues_ts[, 2], type ="none", lags=1))
summary(ur.df(issues_ts[, 1], type ="none", lags=1))
summary(ur.df(issues_ts[, 1], type ="none", lags=1))
names(issues_ts)
issues_ts[1,]
summary(ur.df(issues_ts[, 1], type ="none", lags=1))
summary(ur.df(issues_ts[, 2], type ="none", lags=1))
summary(ur.df(issues_ts[, 43], type ="none", lags=1))
summary(ur.df(issues_ts[, 43], type ="trend", lags=1))
summary(ur.df(issues_ts[, 43], type ="none", lags=1))
summary(ur.df(issues_ts[, 1], type ="none", lags=1))
ur.df(issues_ts[, 1], type ="none", lags=1)
for(i in 2:ncol(issues_ts)) {
ur.df(issues_ts[, i], type ="none", lags=1)
}
ur.df(issues_ts[, i], type ="none", lags=1)
test <- ur.df(issues_ts[, i], type ="none", lags=1)
test
for(i in 2:ncol(issues_ts)) {
test <- ur.df(issues_ts[, i], type ="none", lags=1)
cat(test)
}
class(test)
as.character(test)
for(i in 2:ncol(issues_ts)) {
test[i] <- ur.df(issues_ts[, i], type ="none", lags=1)
}
ur.df(issues_ts[, 1], type ="none", lags=1)
ur.df(issues_ts[, sprintf("%s", c(1,2,3))], type ="none", lags=1)
ur.df(issues_ts[, sprintf("%i", c(1,2,3))], type ="none", lags=1)
ur.df(issues_ts[, 2], type ="none", lags=1)
ur.df(issues_ts[, 3], type ="none", lags=1)
i <- 0
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i <- i + 1
ur.df(issues_ts[, i], type ="none", lags=1)
i
issueheads
length(issuelist[[2]])
# List all issues in one row
for(i in 1:length(issueheads)) {
cat(issueheads[i], "\n")
}
vIssues <- VAR(issues_ts, p=1, type="both")
issues_ts[1:20,1]
issues_ts[,1]
issues_ts[1,]
issues_ts[1:21,]
issues_ts[,1:21]
issues_ts[1,1:21]
issues_ts[1,22:43]
issues_ts[1,22:44]
issues_ts[1,22:43]
plot(irf(vIssues, impulse = names(issues_ts[1:21]), response = names(issues_i[22:43])))
require(stringr)
require(reshape2)
require(ggplot2)
require(vars)
vIssues
plot(irf(vIssues, impulse = names(issues_ts[1:21]), response = names(issues_i[22:43])))
plot(irf(vIssues, impulse = names(issues_ts[1:21]), response = names(issues_ts[22:43])))
issues_s
names(issues_s)
names(issues_s[2:23])
names(issuesi[2:22])
names(issues_i[2:22])
plot(irf(vIssues, impulse = names(issues_s[2:23]), response = names(issues_i[2:22])))
plot(irf(vIssues, impulse = names(issues_s[2:23]), response = names(issues_i[2:22])))
plot(irf(vIssues, impulse = names(issues_s[2:23]), response = names(issues_i[2:22])))
irf(vIssues, impulse = names(issues_s[2:23]), response = names(issues_i[2:22]))
vIRF <- irf(vIssues, impulse = names(issues_s[2:23]), response = names(issues_i[2:22]))
summary(vIRF)
vIRF$irf
vIRF$boot
vIRF$ortho
vIRF$Lower
vIRF$irf[1]
vIRF$irf["s.boko"]
summary(issues$hk)
summary(issues$s.hk)
summary(issues$s.nsa)
summary(issues$s.gaza)
summary(issues$s.boko)
summary(issues$s.ebola)
summary(issues$s.edathy)
summary(issues$s.ferguson)
summary(issues$s.gurlitt)
summary(issues$s.is)
summary(issues$s.pegida)
summary(issues$s.schumi)
summary(issues$s.tebartz)
summary(issues$s.wm)
summary(issues$s.wulff)
plot(vIRF)
names(issues)
summary(issues[2:44])
plot(vIRF)
plot(vIRF, x=300, y=200)
plot(vIRF, res = 300)
plot(vIRF[1])
plot(vIRF$irf[1])
summary(issues[2:44])
ur.df(issues_ts[, i], type ="none", lags=1)
summary(ur.df(issues_ts[, i], type ="none", lags=1))
summary(ur.df(issues_ts[,30], type ="none", lags=1))
summary(issues[2])
stats_entropy
names(issues)
issues_bak <- issues
issues$total <- rowSums(issues[2:ncol(issues)])
issues$entropy <- 0
names(issues)
issues$total <- rowSums(issues[2:ncol(issues)])
issues$entropy <- 0
for(r in 1:nrow(issues)) {
curtotal <- as.numeric(issues$total[r])
curp <- 0
for(c in 2:ncol(issues)) {
curcount <- as.numeric(issues[r,c])
curp[c] <- curcount / curtotal
}
curp <- curp [2:length(curp)-2]
curdrop <- which(curp==0)
curp <- curp[-curdrop]
issues$entropy[r] <- sum(-1 * curp * log(curp))
}
stats_entropy <- data.frame(date=drange)
stats_entropy$entropy <- issues$entropy
stats_entropy <- melt(stats_entropy, id="date")
g_entrop <- ggplot(data = stats_entropy, aes(x=date,y=value,colour=variable, group=variable)) +
geom_line() +
geom_smooth(size=1,formula = y ~ x, method="loess", se=FALSE, color=1) +
xlab("Zeitraum") + ylab("Entropie") +
scale_colour_discrete(name = "", labels = "Entropie") +
theme(legend.title = element_text(size=14)) +
theme(legend.text = element_text(size=12)) +
theme(axis.title = element_text(size = 14))
g_entrop
View(issues)
summary(issues$entropy)
summary(issues$total)
stats_total
summary(issues[2:44])