Background
In the following exploration, we will inspect the relationship between the major Australian political parties and their adherents. Also, we will explore the influence of politics in a social system such as that of Australia using data obtained from Twitter, a social media platform.
Social systems are defined by relationships among people. With the increasingly socialized world of today, the media plays a critical role for evaluation of different social trends. Some of the areas in which social media can be used for monitoring include:
- Media trends
- Political trends
- Business trends
- Music trends, etcetera
Over the years, digital and technological innovations have been on what can be considered “inflation”, with almost each day recording an innovation. This has simultaneously enabled new methods of collecting useful data, exploring the data and coming up with important insights that have greatly contributed to the amount of knowledge on different social issues.
Li et al. (2010) defines social media as “a conversational, distributed mode of content generation, dissemination, and communication among communities…” According to their study, social media has defined a whole new meaning of social confines and interactions. This broadly interprets to freedom from traditional geographical limitations that hindered interactions and therefore monitoring of social media interactions among different groups can provide insightful information of:
- Peoples’ consumer preferences
- Peoples political interests and affiliations
- The society’s view on current and emerging trends on political
In this study, we will explore different political affiliations for different groups of people given three political leaders of different political parties. We will explore data from imported from twitter to establish whether different people keep relations with people from different political parties or whether they are enemies owing to their difference in political allegiance. Through this, we will establish the truth of the common fallacy that: “people with different political affiliations are actually enemies even in real life”
Data for this project is extracted from 10 twitter friends from each of:
- Malcolm Turnbull of the Liberal Party of Australia
- Bill Shorten of the Australian Labor Party
- Michael McCormack of the National Party of Australia
In order to explore relationship between different friends of different political leaders, we will further mine data on 1000 friends of the first ten friends of a each politician.
- Twitter apps
- R statistical software
- R dependent packages
In this project we will test the following hypotheses:
Null hypothesis
H0: Political parties are disjoint
Alternative hypotheses
H1: Political parties are non-disjoint
H2: People are still friends despite different political affiliations
In the cause of our research project, we assume that:
- Every friend of a politician is interested in politics and has a political opinion
- Any friend of a politician shares the politician’s political ideology
- Every friend is unique, I.e holds a definite political view.
library(httr)
library(twitteR)
library(twitteR)
library(“openssl”)
library(“httpuv”)
library(“base64enc”)
consumerKey <- “qqNvwX4KY5uuP3dwUovKxbaTB”
consumerSecret <- “7PZVZB4dX1eiL0713YWG5rdaDhcoGZPzw71l1iWxYqH3ptu2Nd”
accessToken <- “818345262221590528-nn33pinbmGIQ7TsiA3v7QDCrXr87fPw”
accessTokenSecret <- “fVsUi0djqxc2vqENm6aUoB1eCFt2SCAeTl57dgoUU7wXM”
setup_twitter_oauth(consumerKey, consumerSecret, accessToken, accessTokenSecret)
#importing twitter id’s
#Malcolm Turnbull
tanbull = getUser(“@TurnbullMalcolm”)
tanbullfrends = tanbull$getFriends(10)
Social Media’s Role in Monitoring Social Trends
tanbullfrends
$`36275767`
[1] “CommGamesAUS”
$`103999368`
[1] “sydneyroosters”
$`2300779218`
[1] “MarisePayne”
$`111449574`
[1] “alannahmadeline”
$`208528305`
[1] “tweetinjules”
$`36872712`
[1] “SenatorRyan”
$`224846346`
[1] “SouthernStars”
$`49574044`
[1] “nthqldcowboys”
$`263378242`
[1] “TheMatildas”
$`110855776`
- “Socceroos”
#Bill Shorten
billshort = getUser(“@billshortenmp”)
billshortfrends = billshort$getFriends(10)
billshortfrends
$`1368753678`
[1] “DomLorrimer”
$`135057136`
[1] “WSFM1017”
$`3168147002`
[1] “GOFoundationAU”
$`129402565`
[1] “joelcreasey”
$`889348386779836416`
[1] “LoveIslandAU”
$`20356090`
[1] “adamrichard”
$`21654257`
[1] “Briggs”
$`216876629`
[1] “lisa_fernandez”
$`37621265`
[1] “steenrasko”
$`110138384`
[1] “MahaliaBarnes”
mccormac= getUser(“@M_McCormackMP”)
mccormacfrends = mccormac$getFriends(11)
Mccormacfrends
$`851828803219410944`
[1] “4roadsafety”
$`39937499`
- “FarmOnline”
$`36275767`
- “BeddingtTrol”
$`987679153`
[1] “ALGAcomms”
$`17939037`
[1] “ProfBrianCox”
$`626111072`
[1] “astroduff”
$`48927175`
[1] “TomMcIlroy”
$`2393844469`
[1] “lindareynoldswa”
$`2602764942`
[1] “maculardisease”
$`359750088`
[1] “ItaButtrose”
#comparing if there are any similar friends shared by the politicians
#between Tanbull and billshort
names(tanbullfrends)%in%names(billshortfrends)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#between Tanbull and Mccormac
names(tanbullfrends)%in%names(mccormacfrends)
- FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#between Billshort and Mccormac
names(billshortfrends)%in%names(mccormacfrends)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
From the data we collected, we find that there were 60 entries for the three candidates combined, however there were no shared friends among the three politicians given the first 10 friends. This implies that, taking the assumption of the most staunch supporters being the first friends of each politician. Then, there are little chances of a supporter having allegiance to two politicians. Therefore, we can conclude that, in politics support and allegiance are key indicators of the ideologies one believes in.
library(igraph)
library(dplyr)
##Collecting data for comparing relationships between friends
compare1<-tanbullfrends [[1]]$getFriends(1000)
compare2<-tanbullfrends [[2]]$getFriends(1000)
compare3<-tanbullfrends [[3]]$getFriends(1000)
compare_1<-mccormacfrends [[1]]$getFriends(1000)
compare_2<-mccormacfrends [[2]]$getFriends(1000)
compare_3<-mccormacfrends [[3]]$getFriends(1000)
compare_1<-mccormacfrends [[1]]$getFriends(1000)
compare_2<-mccormacfrends [[2]]$getFriends(1000)
compare_3<-mccormacfrends [[3]]$getFriends(1000)
#friendslist
frendlist<-names(compare1)
summary(frendlist)
Length Class Mode
499 character character
combndfrends<-names(Combinedfriendlist)
#comparing similar friends among the friends
library(compare)
comprsn <- compare(combndfrends,frendlist,allowAll=TRUE)
comprsn$tM
[1] “103999368” “110138384” “110855776”
[4] “111449574” “129402565” “135057136”
[7] “1368753678” “17939037” “20356090”
[10] “208528305” “21654257” “216876629”
[13] “224846346” “2300779218” “2393844469”
[16] “2602764942” “263378242” “3168147002”
[19] “359750088” “36275767” “36872712”
[22] “37621265” “39937499” “48927175”
[25] “49574044” “626111072” “851828803219410944”
[28] “889348386779836416” “987679153”
#plotting relationships
deta<-as.matrix(get.adjacency(graph.data.frame(relashionshpdta))
grp<-graph_from_adjacency_matrix(deta, mode =”undirected”,weighted=NULL,diag=FALSE)
plot.igraph(grp,layout=layout.circle,edge.color=”skyblue”)
Elsewhere, Given 1000 friends from each of the 10 friends, we found out that there were 499 common friends at least among two politicians and 44 shared friends shared among the three politicians. Implying that despite difference in political affiliations among different people, they still do maintain friendships among themselves and therefore politics does not cause volatility among citizens. As such, it indicates a relative amount of independence in adoption and translation. However, the low percentage of interrelations may indicate that politics has a role in volatizing the masses.
Hypotheses
#calculating edge
edge_density(grp, loops=F)
0.02429379
reciprocity(grp)
- 1
transitivity(grp)
[1] 0
#calculating size neighbourhood of each edge
neihbourhood<-as.matrix(neighborhood.size(grp,1000))
Neihbourhood
[,1]
[1,] 3
[2,] 2
[3,] 2
[4,] 2
[5,] 2
[6,] 2
[7,] 2
[8,] 2
[9,] 2
[10,] 2
[11,] 2
[12,] 2
[13,] 3
[14,] 3
[15,] 2
[16,] 3
[17,] 5
[18,] 5
[19,] 2
[20,] 2
[21,] 3
[22,] 5
[23,] 5
[24,] 2
[25,] 2
[26,] 2
[27,] 2
[28,] 2
[29,] 2
[30,] 2
[31,] 2
[32,] 2
[33,] 3
[34,] 2
[35,] 2
[36,] 2
[37,] 2
[38,] 2
[39,] 2
[40,] 2
[41,] 2
[42,] 2
[43,] 2
[44,] 2
[45,] 3
[46,] 2
[47,] 3
[48,] 5
[49,] 2
[50,] 2
[51,] 2
[52,] 2
[53,] 2
[54,] 2
[55,] 2
[56,] 2
[57,] 2
[58,] 3
[59,] 2
[60,] 2
#modularity
modularity(medntlgenceceb)
- 9356409
highsocialclp <- cluster_label_prop(grp)
highsocialclp
IGRAPH clustering label propagation, groups: 27, mod: 0.94
+ groups:
$`1`
[1] “A” “103999368” “36275767”
$`2`
[1] “B” “111449574”
$`3`
[1] “C” “1368753678”
$`4`
Additionally, according to Moreno et al. (2017), “High modularity for a partitioning reflects dense connections within communities and sparse connections across communities…” in our case we obtain a modularity of 0.9356409 which is relatively high while our density is 0.02429379. The neighborhoods fall within 2 and 5. Additionally, there were 27 nodes having high social capital.
#defining function to be used
ehomphil<-function(graph,vertex.attr){
#ego-hemophili
nodehomo<-as.vector(rep(NA,vcount(graph)))
#repeat for every node
for(t in 1:vcount(graph)){
if(degree(graph,V(graph)[t])>0){
#get the neighbors
node.alters<-ego(graph,1,nodes=V(graph)[t],mode=”out”)
Node_ec<-get.vertex.attribute(graph,vertex.attr,V(graph)[t])
#extract neighbors with matching attribute value nodehomo[t]<-sum(get.vertex.attribute(graph,vertex.attr,node.alters[[1]])==ec)/length(node.alters[[1]])
}
}
return(nodehomo)
}
data
[1] “1368753678” “135057136” “3168147002”
[4] “129402565” “889348386779836416” “20356090”
[7] “21654257” “216876629” “37621265”
[10] “110138384” “36275767” “103999368”
[13] “2300779218” “111449574” “208528305”
[16] “36872712” “224846346” “49574044”
[19] “263378242” “110855776” “851828803219410944”
[22] “39937499” “987679153” “17939037”
[25] “626111072” “48927175” “2393844469”
[28] “2602764942” “359750088”
labour_party
[1] “1368753678” “135057136” “3168147002”
[4] “129402565” “889348386779836416” “20356090”
[7] “21654257” “216876629” “37621265”
[10] “110138384”
combined_party
[1] “36275767” “103999368” “2300779218”
[4] “111449574” “208528305” “36872712”
[7] “224846346” “49574044” “263378242”
[10] “110855776” “851828803219410944” “39937499”
[13] “987679153” “17939037” “626111072”
[16] “48927175” “2393844469” “2602764942”
[19] “359750088”
#calculating hemophily
V(nodegg)$Politics<-sample(c(“Labour party”,”Other Party”),100,replace=T)
V(nodegg)$Social<-sample(c(“None”,”Does not relate”,”Relates”),100,replace=T)
V(nodegg)$ehomphil<-ego_homophily(graph = nodegg, vertex.attr = “Social”)
hemophili<-V(nodegg)$ehomphil
#dealing with missing values
hemophili[is.na(hemophili)]<-0
hemophili
[1] 0.6666667 0.3750000 0.2857143 0.1428571 0.1111111 0.5000000 1.0000000
[8] 0.4000000 0.5000000 0.6000000 1.0000000 0.6363636 0.7500000 0.0000000
[15] 0.5000000 0.2500000 0.5000000 0.2500000 0.5000000 0.3333333 0.5000000
[22] 0.7500000 0.5000000 1.0000000 0.2500000 0.2857143 0.5000000 0.1666667
[29] 0.4285714 0.1250000 0.8000000 0.3333333 0.5000000 0.6666667 0.4000000
Data Collection and Analysis
[36] 0.3333333 0.2857143 0.3750000 0.5000000 0.6000000 0.5000000 0.2500000
[43] 0.4444444 0.7142857 0.6666667 0.2000000 0.3333333 0.4000000 0.6666667
[50] 0.5000000 0.2000000 0.6000000 0.4000000 0.2500000 0.7500000 0.8571429
[57] 0.5000000 0.5000000 0.6000000 0.4285714 0.2500000 0.6000000 0.4166667
[64] 0.3333333 0.6000000 0.2500000 0.3333333 0.4285714 0.6000000 1.0000000
[71] 0.5000000 0.4000000 0.1428571 0.4444444 0.0000000 0.6666667 1.0000000
[78] 0.4285714 0.6666667 0.3333333 0.5714286 1.0000000 0.5000000 0.5000000
[85] 0.5000000 0.4000000 0.1666667 0.6666667 0.1818182 0.2857143 0.2727273
[92] 0.3750000 0.2000000 0.2000000 0.2222222 0.3333333 0.5000000 0.5714286
[99] 0.4000000 0.1250000
mean(hemophili)
[1] 0.4572861
sd(hemophili)
- 2259754
#plotting graph for homophilly
hist(hemophili,main=”Histogram for Network Homophily”,
xlab=”Network Homophily”,freq=T,xlim=c(0,1))
lines(density(hemophili),lty=”dotted”,lwd=2,col=”skyblue”)
abline(v=mean(hemophili),lwd=2,col=”red”)
From our study, the average Homophily between labor party supporters and the supporters of both the Liberal and National parties combined given an alpha-level of 0.05 is 0.4572861
medntlgenceceb <- cluster_edge_betweenness(grp)
dendPlot(medntlgenceceb, mode=”hclust”)
plot(medntlgenceceb, grp)
From the graph we realize the network is a weak network due to the hierarchical distribution of different nodes that represent connection among members of the test society. Despite it being a weak network, there are no outliers in the data. I.e. no abnormal relationships. Generally because of the disjoint among supporters of different parties, this is true from the fact that the politicians do not share common supporters.
Yes, from our analysis we establish that different adherents of different parties are loyal and hence Australian politics can be assumed to be disjoint. In that no single friend of a politician is partisan among the political parties.
True, as noted from our analysis, different members are friends with other members despite the other members political affiliations. Therefore, it would be a fallacy to assume disjointedness among members of political parties. In that respect, we can argue that, despite difference in political ideologies members can still be friend and the few “outliers” are only probably acting for themselves.
Conclusion
We can confide that social media intelligence is one of the better modern ways that can be used to gather Intel that will aid in gaining insight on contemporary social issues. Nevertheless, despite the tremendous benefits embed in social media intelligence, it is also wrought with some negative shades. This include:
- The potential of gathering an authorized third-party information, which may lead to legal action
- Willful manipulation of target audience given background insights on their preferences, etcetera
However, despite this side of this new digital development, we can rake benefits if properly utilized. For instance, from our research we realize that, it is not always that people having different political ideologies fail to hold relationships, however limited the frequency. This can help counter the rising claims of Australia becoming more polarized and help quieten naysayers while actually promoting social integration despite political differences. It may therefore be considered illogical and assumptive to conclude that members of different parties hate each other.
Hoover, JN (2007). US spy agencies go Web 2.0 in effort to better share information. InformationWeek, 23 August. Available at: https://www.informationweek.com/news/internet/showArticle.jhtml?articleID=20
1801990 Google Scholar
Mandel, M (2010).British jokester freed after learning police not amused. Toronto Sun, 1 July: 8. Google Scholar
Van Dijck, J, Nieborg, D (2009).Wikinomics and its discontents: a critical analysis of Web 2.0 business manifestos. New Media & Society 11(5): 855–874. Google
Scholar, SAGE Journals, ISI
Joseph, K & Benjamin, B (2018) The Political Significance of Social Media Activity and Social Networks, Political Communication, DOI: 10.1080/10584609.2018.1426662
Best, S. J., & Krueger, B. S. (2005). Analyzing the representativeness of Internet political participation. Political Behavior, 27(2), 183–216. [Crossref], [Web of
Science ®] ,[Google Scholar]
Bond, R. M., Fariss, C. J., Jones, J. J., Kramer, A. D. I., Marlow, C., Settle, J. E., & Fowler, J. H. (2012). A 61-million-person experiment in social influence and political mobilization. Nature, 489(7415), 295–298.[Crossref], [PubMed], [Web of Science ®],[Google Scholar]
Gibson, R., & Cantijoch, M. (2013). Conceptualizing and measuring participation in the age of the Internet: Is online political engagement really different to offline? Journal of Politics, 75(3), 701–716.[Crossref], [Web of Science ®], [Google
Scholar]
Ognyanova,K.(2016).Network Analysis and Visualization with R and igraph.Available at: https://www.kateto.net/wp-content/uploads/2016/01/NetSciX_2016_Wor
kshop.pdf
Al-Qaheri, H., Banerjee,S. and Ghosh G.(2103) “Evaluating the power of homophily and graph properties in Social Network: Measuring the flow of inspiring influence using evolutionary dynamics,” 2013 Science and Information Conference, London, 2013, pp. 294-303.