Libraries:
The libraries utilized in this project are ggplot2, tidyverse, coefplot, anesr, and stargazer.
### Calls the ggplot2 Package ###
library(ggplot2)
### Calls the tidyverse Package ###
library(tidyverse)
### Calls the anesr Package ###
library(anesr)
### Calls the coefplot Package ###
library(coefplot)
### Calls the stargazer Package ###
library(stargazer)
Data and Functions:
The data for this project comes from the American National Election Survey from 2016 (anes16). From the anes16 we identified the columns that were associated with television programs, whether the respondent voted in the 2016 election (referred to as Turnout or Vote from here on out), and whether or not the respondent was registered to vote prior to the 2016 election (referred to as Registered, Register, or Registration from here on out).
### Assigns data as time series 2016 ###
data("timeseries_2016")
### Assigns the time series 2016 as anes16 ###
anes16 <- timeseries_2016
### Selects the variables/columns that ask whether the respondent has watched a given program ###
TV <- anes16 %>% select(V161364, V161365, V161366, V161367, V161368, V161369, V161370, V161371, V161372, V161373, V161374, V161375, V161376, V161377, V161378, V161379, V161380, V161381, V161382, V161383, V161384, V161385, V161386, V161387, V161388, V161389, V161390, V161391, V161392, V161393, V161394, V161395, V161396, V161397, V161398, V161399, V161400, V161401, V161402, V161403, V161404, V161405, V161406, V161407, V161408, V161409, V161410, V161411, V162034)
### Assigns the variable/column that asks whether or not a respondent registered to vote prior to the 2016 election this variable serves to indicate this fact, but is not used later ###
Did_You_Register <- anes16 %>% select(V161011)
### Assigns the variable/column that asks whether or not a respondent voted in the 2016 election this variable serves to indicate this fact, but is not used later ###
Did_You_Vote <- anes16 %>% select(V162034)
### A function that eliminates nonsensical values from the data (values that are coded as less than 0) used later to clean the data set anes16 ###
clean <- function(x){ifelse (x < 0, NA, x)}
Programs Assigned:
Each column/Variable asks whether the respondent has watched a given program is assigned to the name of the program that it pertains to and is made usable in regression.
### Selects each column/variable from the TV data set which is made up of the variables/columns that ask whether the respondent has watched a given program then unlists the variable/column to make it usable for regression then assigns the unlisted variable/column to the name of the actual program ###
Twenty_Twenty <- TV %>% select (V161364) %>% unlist()
All_In_with_Chris_Hayes <- TV %>% select (V161365) %>% unlist()
The_Blacklist <- TV %>% select (V161366) %>% unlist()
CBS_Evening_News_with_Scott_Pelley <- TV %>% select (V161367) %>% unlist()
Criminal_Minds <- TV %>% select (V161368) %>% unlist()
Empire <- TV %>% select (V161369) %>% unlist()
Hannity <- TV %>% select (V161370) %>% unlist()
Jimmy_Kimmel_Live <- TV %>% select (V161371) %>% unlist()
The_Kelly_File <- TV %>% select (V161372) %>% unlist()
Modern_Family <- TV %>% select (V161373) %>% unlist()
NCIS <- TV %>% select (V161374) %>% unlist()
The_Nightly_Show_with_Larry_Wilmore <- TV %>% select (V161375) %>% unlist()
Sunday_Night_Football <- TV %>% select (V161376) %>% unlist()
Scorpion <- TV %>% select (V161377) %>% unlist()
The_Simpsons <- TV %>% select (V161378) %>% unlist()
Today <- TV %>% select (V161379) %>% unlist()
Sixty_Minutes <- TV %>% select (V161380) %>% unlist()
Anderson_Cooper_Three_Hundred_and_Sixty <- TV %>% select (V161381) %>% unlist()
CBS_This_Morning <- TV %>% select (V161382) %>% unlist()
Dancing_with_the_Stars <- TV %>% select (V161383) %>% unlist()
Face_the_Nation <- TV %>% select (V161384) %>% unlist()
House_of_Cards <- TV %>% select (V161385) %>% unlist()
Hardball_with_Chris_Matthews <- TV %>% select (V161386) %>% unlist()
Judge_Judy <- TV %>% select (V161387) %>% unlist()
Meet_the_Press <- TV %>% select (V161388) %>% unlist()
Game_of_Thrones <- TV %>% select (V161389) %>% unlist()
NBC_Nightly_News_with_Lester_Holt <- TV %>% select (V161390) %>% unlist()
On_the_Record_with_Greta_Van_Susteren <- TV %>% select (V161391) %>% unlist()
Daredevil <- TV %>% select (V161392) %>% unlist()
The_Rachel_Maddow_Show <- TV %>% select (V161393) %>% unlist()
Shark_Tank <- TV %>% select (V161394) %>% unlist()
The_Voice <- TV %>% select(V161395) %>% unlist()
ABC_World_News_with_David_Muir <- TV %>% select (V161396) %>% unlist()
Blue_bloods <- TV %>% select (V161397) %>% unlist()
Conan <- TV %>% select (V161398) %>% unlist()
Dateline_NBC <- TV %>% select (V161399) %>% unlist()
Good_Morning_America <- TV %>% select (V161400) %>% unlist()
Hawaii_Five_O <- TV %>% select (V161401) %>% unlist()
Madam_Secretary <- TV %>% select (V161402) %>% unlist()
Nancy_Grace <- TV %>% select (V161403) %>% unlist()
Erin_Burnett_Outfromt <- TV %>% select (V161404) %>% unlist()
PBS_News_Hour <- TV %>% select (V161405) %>% unlist()
Scandal <- TV %>% select (V161406) %>% unlist()
The_Big_Bang_Theory <- TV %>% select (V161407) %>% unlist()
The_Late_Show_with_Stephen_Colbert <- TV %>% select(V161408) %>% unlist()
The_O_Reilly_Factor <- TV %>% select (V161409) %>% unlist()
The_Tonight_Show_Starring_Jimmy_Fallon <- TV %>% select(V161410) %>% unlist()
Alpha_House <- TV %>% select(V161411) %>% unlist()
Regression for each Program with Turnout as the Dependent Variable:
We grouped programs together with similar content and performed a linear regression on them in order to visualize the relationship between a program and turnout against programs with similar content to see the effect that each program had on turnout compared to other programs with similar content.
We then also grouped all of the programs together and performed a linear regression on them in order to visualize the relationship between all of the programs and turnout against each other to see the effect that each program had on turnout compared to other programs regardless of the program’s content.
The groups are: Traditional Political News programs (Sixty Minutes, Face the Nation etc.), Entertainment or Opinion News Programs (Jimmy Kimmel Live, The Kelly File etc.), Entertainment Programs that are Expressly Political (House of Cars, Madam Secretary etc.), Entertainment Programs that Focus on a Salient Political Issue in this data set that issue is always Criminal Justice (Criminal Minds, Blue Bloods etc.), and Apolitical Programs (Sunday Night Football, The Big Bang Theory etc.).
Grouped variable names are named as such. The name of the category ex. Traditional_Political_News_Programs, then the word Vote to denote that the dependent variable is voting, and then lm to show that a linear regression has now been done.
### Creates the variable Vote for whether or not the respondent Voted in the 2016 election ###
anes_clean <- anes16 %>%
mutate(across (everything(), clean)) %>%
mutate(Vote = case_when(
V162034 == 2 ~ 0,
V162034 == 1 ~ 1))
### Regression for Traditional Political News Programs and Turnout ###
Traditional_Political_News_Programs_Vote_lm <- lm(Vote ~ Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour , data = anes_clean)
### Regression for Entertainment or Opinion Political News Programs and Turnout ###
Entertainment_or_Opinion_Political_News_Programs_Vote_lm <- lm(Vote ~ All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor , data = anes_clean)
### Regression for Entertainment Programs that are Expressly Political and Turnout ###
Expressly_Political_Entertainment_Programs_Vote_lm <- lm(Vote ~ House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House , data = anes_clean)
### Regression for Entertainment Programs that are not Expressly Political but Focus on a Salient Political Issue and Turnout###
Entertainment_Programs_that_Focus_on_a_salient_Political_Issue_Vote_lm <- lm(Vote ~ The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O, data = anes_clean)
### Regression for Entertainment Programs with little to No Political Content and Turnout###
Apolitical_Entertainment_Programs_Vote_lm <- lm(Vote ~ Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon, data = anes_clean)
### Regression for All Variables and Turnout ###
All_Variables_Vote_lm <- lm(Vote ~ Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour + All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor + House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House + The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O + Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon, data = anes_clean)
The Plots and Summaries for the Regression Performed on the Programs with Turnout as the Dependent Variable:
We utilized the stargazer function from the Stargazer package to summarize the findings from the regression performed on the programs with turnout as the dependent variable. We then used the coefplot function from the Coefplot package to visualize the regression performed on the programs with turnout as the dependent variable.
### Summary for Traditional Political News Programs with Turnout as the Dependent Variable ###
stargazer(Traditional_Political_News_Programs_Vote_lm, title = "Summary for Traditional News Programs and Turnout" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Traditional News Programs and Turnout
## ==============================================================
## Dependent variable:
## ---------------------------
## Vote
## --------------------------------------------------------------
## Twenty_Twenty -0.012* (0.007)
## CBS_Evening_News_with_Scott_Pelley -0.002 (0.007)
## Sixty_Minutes -0.001 (0.006)
## Face_the_Nation 0.007 (0.009)
## Meet_the_Press -0.002 (0.008)
## NBC_Nightly_News_with_Lester_Holt 0.0004 (0.006)
## ABC_World_News_with_David_Muir -0.002 (0.006)
## Dateline_NBC 0.009 (0.007)
## PBS_News_Hour 0.002 (0.007)
## Constant 0.986*** (0.002)
## --------------------------------------------------------------
## Observations 2,730
## R2 0.002
## Adjusted R2 -0.001
## Residual Std. Error 0.119 (df = 2720)
## F Statistic 0.634 (df = 9; 2720)
## ==============================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Traditional Political News Programs with Turnout as the Dependent Variable ###
coefplot::coefplot(Traditional_Political_News_Programs_Vote_lm) + labs(title = "Coefficent Plot of Traditional\nNews Programs by Turnout" , caption = "Data from the American National Election Survey 2016", x = "Turnout" , y = "Traditional News Programs") + theme_dark()
### Summary for Entertainment or Opinion Political News_Programs with Turnout as the Dependent Variable ###
stargazer(Entertainment_or_Opinion_Political_News_Programs_Vote_lm , title = "Summary for Entertainment or Political News Programs and Turnout" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Entertainment or Political News Programs and Turnout
## ===================================================================
## Dependent variable:
## ---------------------------
## Vote
## -------------------------------------------------------------------
## All_In_with_Chris_Hayes 0.011 (0.014)
## Hannity 0.005 (0.010)
## Jimmy_Kimmel_Live -0.013* (0.008)
## The_Kelly_File -0.006 (0.010)
## The_Nightly_Show_with_Larry_Wilmore -0.011 (0.014)
## Today 0.009 (0.006)
## Anderson_Cooper_Three_Hundred_and_Sixty 0.005 (0.007)
## CBS_This_Morning -0.004 (0.007)
## Hardball_with_Chris_Matthews -0.007 (0.011)
## On_the_Record_with_Greta_Van_Susteren -0.003 (0.010)
## The_Rachel_Maddow_Show 0.009 (0.010)
## Good_Morning_America -0.007 (0.006)
## Nancy_Grace 0.006 (0.011)
## Erin_Burnett_Outfromt -0.004 (0.012)
## The_O_Reilly_Factor 0.009 (0.009)
## Constant 0.985*** (0.003)
## -------------------------------------------------------------------
## Observations 2,730
## R2 0.004
## Adjusted R2 -0.001
## Residual Std. Error 0.119 (df = 2714)
## F Statistic 0.794 (df = 15; 2714)
## ===================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Entertainment or Opinion Political News_Programs with Turnout as the Dependent Variable ###
coefplot::coefplot(Entertainment_or_Opinion_Political_News_Programs_Vote_lm) + labs(title = "Coefficent Plot of Entertainment or Opinion\nPolitical News Programs by Turnout" , caption = "Data from the American National Election Survey 2016", x = "Turnout" , y = "Entertainment or Opinion Political News Programs") + theme_dark()
### Summary for Expressly Political Entertainment Programs with Turnout as the Dependent Variable ###
stargazer(Expressly_Political_Entertainment_Programs_Vote_lm , title = "Summary for Expressly Political Entertainment Programs and Turnout" , type = "text", align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Expressly Political Entertainment Programs and Turnout
## ===============================================
## Dependent variable:
## ---------------------------
## Vote
## -----------------------------------------------
## House_of_Cards -0.003 (0.008)
## Game_of_Thrones -0.008 (0.007)
## Madam_Secretary -0.001 (0.008)
## Scandal 0.015* (0.008)
## Alpha_House -0.005 (0.012)
## Constant 0.985*** (0.003)
## -----------------------------------------------
## Observations 2,730
## R2 0.002
## Adjusted R2 0.0001
## Residual Std. Error 0.119 (df = 2724)
## F Statistic 1.066 (df = 5; 2724)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Expressly Political Entertainment Programs with Turnout as the Dependent Variable ###
coefplot::coefplot(Expressly_Political_Entertainment_Programs_Vote_lm) + labs(title = "Coefficent Plot of Expressly Political\nEntertainment Programs by Turnout" , "Data from the American National Election Survey 2016", x = "Turnout" , y = "Entertainment or Opinion Political News Programs") +theme_dark()
### Summary for Entertainment Programs that Focus on a Salient Political Issue with Turnout as the Dependent Variable ###
stargazer(Entertainment_Programs_that_Focus_on_a_salient_Political_Issue_Vote_lm , title = "Summary for Entertainment Programs that Focus on a Salient Political Issue and Turnout" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Entertainment Programs that Focus on a Salient Political Issue and Turnout
## ===============================================
## Dependent variable:
## ---------------------------
## Vote
## -----------------------------------------------
## The_Blacklist 0.003 (0.008)
## Criminal_Minds 0.004 (0.007)
## NCIS -0.0003 (0.007)
## Scorpion -0.012 (0.009)
## Judge_Judy -0.006 (0.007)
## Daredevil 0.006 (0.010)
## Blue_bloods 0.005 (0.008)
## Hawaii_Five_O -0.001 (0.009)
## Constant 0.985*** (0.003)
## -----------------------------------------------
## Observations 2,730
## R2 0.001
## Adjusted R2 -0.002
## Residual Std. Error 0.119 (df = 2721)
## F Statistic 0.454 (df = 8; 2721)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
## Coefficient Plot for Entertainment Programs that Focus on a Salient Political Issue with Turnout as the Dependent Variable ###
coefplot::coefplot(Entertainment_Programs_that_Focus_on_a_salient_Political_Issue_Vote_lm) + labs(title = "Coefficent Plot of Entertainment Programs that\nFocus on a Salient Political Issue by Turnout" , caption = "Data from the American National Election Survey 2016", x = "Turnout" , y = "Entertainment Programs that Focus on a Salient Political Issue") +theme_dark()
### Summary for Apolitical Entertainment Programs with Turnout as the Dependent Variable ###
stargazer(Apolitical_Entertainment_Programs_Vote_lm , title = "Summary for apolitical Entertainment Programs and Turnout" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for apolitical Entertainment Programs and Turnout
## ==================================================================
## Dependent variable:
## ---------------------------
## Vote
## ------------------------------------------------------------------
## Empire -0.001 (0.009)
## Modern_Family 0.005 (0.007)
## Sunday_Night_Football 0.004 (0.005)
## The_Simpsons 0.003 (0.010)
## Dancing_with_the_Stars -0.001 (0.007)
## Shark_Tank -0.002 (0.007)
## The_Voice 0.010 (0.006)
## Conan -0.031*** (0.011)
## The_Big_Bang_Theory 0.009* (0.006)
## The_Tonight_Show_Starring_Jimmy_Fallon 0.001 (0.007)
## Constant 0.980*** (0.003)
## ------------------------------------------------------------------
## Observations 2,730
## R2 0.005
## Adjusted R2 0.002
## Residual Std. Error 0.119 (df = 2719)
## F Statistic 1.433 (df = 10; 2719)
## ==================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Apolitical Entertainment Programs with Turnout as the Dependent Variable ###
coefplot::coefplot(Apolitical_Entertainment_Programs_Vote_lm) + theme_dark() + labs(title = "Coefficent Plot of Apolitical Entertainment\nPrograms by Turnout" , caption = "Data from the American National Election Survey 2016", x = "Turnout" , y = "Apolitical Entertainment Programs") + theme_dark()
### Summary for All Variables with Turnout as the Dependent Variable ###
stargazer(All_Variables_Vote_lm , title = "Summary for All Programs and Turnout" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for All Programs and Turnout
## ===================================================================
## Dependent variable:
## ---------------------------
## Vote
## -------------------------------------------------------------------
## Twenty_Twenty -0.013* (0.007)
## CBS_Evening_News_with_Scott_Pelley 0.0003 (0.007)
## Sixty_Minutes -0.0005 (0.006)
## Face_the_Nation 0.005 (0.009)
## Meet_the_Press -0.005 (0.009)
## NBC_Nightly_News_with_Lester_Holt -0.002 (0.007)
## ABC_World_News_with_David_Muir 0.0001 (0.007)
## Dateline_NBC 0.007 (0.007)
## PBS_News_Hour 0.003 (0.008)
## All_In_with_Chris_Hayes 0.015 (0.015)
## Hannity 0.006 (0.010)
## Jimmy_Kimmel_Live -0.010 (0.009)
## The_Kelly_File -0.006 (0.010)
## The_Nightly_Show_with_Larry_Wilmore 0.008 (0.016)
## Today 0.008 (0.007)
## Anderson_Cooper_Three_Hundred_and_Sixty 0.004 (0.008)
## CBS_This_Morning -0.004 (0.007)
## Hardball_with_Chris_Matthews -0.008 (0.011)
## On_the_Record_with_Greta_Van_Susteren 0.001 (0.011)
## The_Rachel_Maddow_Show 0.011 (0.011)
## Good_Morning_America -0.006 (0.007)
## Nancy_Grace 0.011 (0.012)
## Erin_Burnett_Outfromt 0.001 (0.013)
## The_O_Reilly_Factor 0.010 (0.009)
## House_of_Cards -0.006 (0.009)
## Game_of_Thrones -0.008 (0.008)
## Madam_Secretary 0.0005 (0.009)
## Scandal 0.019** (0.009)
## Alpha_House -0.021 (0.023)
## The_Blacklist 0.001 (0.008)
## Criminal_Minds 0.003 (0.007)
## NCIS -0.003 (0.007)
## Scorpion -0.011 (0.010)
## Judge_Judy -0.006 (0.008)
## Daredevil 0.014 (0.014)
## Blue_bloods 0.003 (0.008)
## Hawaii_Five_O -0.002 (0.009)
## Empire -0.010 (0.010)
## Modern_Family 0.005 (0.007)
## Sunday_Night_Football 0.002 (0.005)
## The_Simpsons -0.001 (0.011)
## Dancing_with_the_Stars -0.002 (0.007)
## Shark_Tank -0.002 (0.007)
## The_Voice 0.008 (0.007)
## Conan -0.036*** (0.013)
## The_Big_Bang_Theory 0.011* (0.006)
## The_Tonight_Show_Starring_Jimmy_Fallon 0.002 (0.007)
## Constant 0.982*** (0.004)
## -------------------------------------------------------------------
## Observations 2,730
## R2 0.015
## Adjusted R2 -0.002
## Residual Std. Error 0.119 (df = 2682)
## F Statistic 0.895 (df = 47; 2682)
## ===================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot with Turnout as the Dependent Variable ###
coefplot::coefplot (All_Variables_Vote_lm) + labs(title = "Coefficent Plot of All\nPrograms by Turnout" , caption = "Data from the American National Election Survey 2016", x = "Turnout" , y = "Apolitical Entertainment Programs") + theme_dark()
Regression for each Program with Registration as the Dependent Variable:
This section is identical to the section on the linear regression performed on the TV programs with turnout/vote as the dependent variable except with registration as the dependent variable.
We grouped programs together with similar content and performed a linear regression on them in order to visualize the relationship between a program and registration against programs with similar content to see the effect that each program had on registration compared to other programs with similar content.
We then also grouped all of the programs together and performed a linear regression on them in order to visualize the relationship between all of the programs and turnout against each other to see the effect that each program had on registration compared to other programs regardless of the program’s content.
The groups are the same as before: Traditional Political News programs (Sixty Minutes, Face the Nation etc.), Entertainment or Opinion News Programs (Jimmy Kimmel Live, The Kelly File etc.), Entertainment Programs that are Expressly Political (House of Cars, Madam Secretary etc.), Entertainment Programs that Focus on a Salient Political Issue in this data set that issue is always Criminal Justice (Criminal Minds, Blue Bloods etc.), and Apolitical Programs (Sunday Night Football, The Big Bang Theory etc.). The groups are: Traditional Political News programs (Sixty Minutes, Face the Nation etc.), Entertainment or Opinion News Programs (Jimmy Kimmel Live, The Kelly File etc.), Entertainment Programs that are Expressly Political (House of Cars, Madam Secretary etc.), Entertainment Programs that Focus on a Salient Political Issue in this data set that issue is always Criminal Justice (Criminal Minds, Blue Bloods etc.), and Apolitical Programs (Sunday Night Football, The Big Bang Theory etc.).
Grouped variable names are named as such. The name of the category ex. Traditional_Political_News_Programs, then the word Registration to denote that the dependent variable is voting, and then lm to show that a linear regression has now been done.
### Creates the variable registration for whether or not the respondent was Registered to Vote prior to the 2016 election ###
anes_clean <- anes16 %>%
mutate(across (everything(), clean)) %>%
mutate(Register = case_when(
V161011 == 2 ~ 0,
V161011 == 1 ~ 1))
### Regression for Traditional Political News Programs and Registration Status ###
Traditional_Political_News_Programs_Register_lm <- lm(Register ~ Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour , data = anes_clean)
### Regression for Entertainment or Opinion Political News Programs and Registration Status ###
Entertainment_or_Opinion_Political_News_Programs_Register_lm <- lm(Register ~ All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor , data = anes_clean)
### Regression for Entertainment Programs that are Expressly Political and Registration Status ###
Expressly_Political_Entertainment_Programs_Register_lm <- lm(Register ~ House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House , data = anes_clean)
### Regression for Entertainment Programs that are not Expressly Political but Focus on a salient Political Issue and Registration Status ###
Entertainment_Programs_that_Focus_on_a_salient_Political_Issue_Register_lm <- lm(Register ~ The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O, data = anes_clean)
### Regression for Entertainment Programs with little to No Political Content and Registration Status ###
Apolitical_Entertainment_Programs_Register_lm <- lm(Register ~ Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon, data = anes_clean)
### Regression for All Variables and Registration Status ###
All_Variables_Register_lm <- lm(Register ~ Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour + All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor + House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House + The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O + Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon, data = anes_clean)
The Plots and Summaries for the Regression Performed on the Programs and with Registration as the Dependent Variable:
We utilized the stargazer function from the Stargazer package to summarize the findings from the regression performed on the programs with registration as the dependent variable. We then used the coefplot function from the Coefplot package to visualize the regression performed on the programs with Registration as the dependent variable.
### Summary for Traditional Political News Programs with Registration as the Dependent Variable ###
stargazer(Traditional_Political_News_Programs_Register_lm , title = "Summary for Traditional News Programs and Registration" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Traditional News Programs and Registration
## ==============================================================
## Dependent variable:
## ---------------------------
## Register
## --------------------------------------------------------------
## Twenty_Twenty -0.026* (0.016)
## CBS_Evening_News_with_Scott_Pelley 0.001 (0.016)
## Sixty_Minutes 0.041*** (0.014)
## Face_the_Nation -0.005 (0.020)
## Meet_the_Press 0.014 (0.019)
## NBC_Nightly_News_with_Lester_Holt -0.016 (0.015)
## ABC_World_News_with_David_Muir -0.002 (0.015)
## Dateline_NBC -0.002 (0.015)
## PBS_News_Hour -0.005 (0.017)
## Constant 0.886*** (0.006)
## --------------------------------------------------------------
## Observations 3,657
## R2 0.003
## Adjusted R2 0.0005
## Residual Std. Error 0.314 (df = 3647)
## F Statistic 1.202 (df = 9; 3647)
## ==============================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Traditional Political News Programs with Registration as the Dependent Variable ###
coefplot::coefplot(Traditional_Political_News_Programs_Register_lm) + labs(title = "Coefficent Plot of Traditional\nNews Programs by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Traditional News Programs") + theme_dark()
### Summary for Entertainment or Opinion Political News_Programs with Registration as the Dependent Variable ###
stargazer(Entertainment_or_Opinion_Political_News_Programs_Register_lm , title = "Summary for Entertainment or Opinion Political News Programs and Registration" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Entertainment or Opinion Political News Programs and Registration
## ===================================================================
## Dependent variable:
## ---------------------------
## Register
## -------------------------------------------------------------------
## All_In_with_Chris_Hayes 0.029 (0.034)
## Hannity 0.032 (0.023)
## Jimmy_Kimmel_Live -0.027 (0.018)
## The_Kelly_File 0.004 (0.024)
## The_Nightly_Show_with_Larry_Wilmore 0.008 (0.033)
## Today 0.003 (0.015)
## Anderson_Cooper_Three_Hundred_and_Sixty 0.018 (0.017)
## CBS_This_Morning 0.007 (0.015)
## Hardball_with_Chris_Matthews -0.014 (0.027)
## On_the_Record_with_Greta_Van_Susteren 0.007 (0.024)
## The_Rachel_Maddow_Show 0.027 (0.025)
## Good_Morning_America 0.001 (0.014)
## Nancy_Grace -0.059** (0.025)
## Erin_Burnett_Outfromt -0.055* (0.030)
## The_O_Reilly_Factor 0.018 (0.021)
## Constant 0.882*** (0.007)
## -------------------------------------------------------------------
## Observations 3,657
## R2 0.006
## Adjusted R2 0.002
## Residual Std. Error 0.314 (df = 3641)
## F Statistic 1.518* (df = 15; 3641)
## ===================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Entertainment or Opinion Political News_Programs with Registration as the Dependent Variable ###
coefplot::coefplot(Entertainment_or_Opinion_Political_News_Programs_Register_lm) + labs(title = "Coefficent Plot of Entertainment or Opinion\nPolitical News Programs by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Entertainment or Opinion Political News Programs") + theme_dark()
### Summary for Expressly Political Entertainment Programs with Registration as the Dependent Variable ###
stargazer(Expressly_Political_Entertainment_Programs_Register_lm , title = "Summary for Expressly Political Entertainment Programs and Registration" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Expressly Political Entertainment Programs and Registration
## ===============================================
## Dependent variable:
## ---------------------------
## Register
## -----------------------------------------------
## House_of_Cards -0.002 (0.020)
## Game_of_Thrones -0.004 (0.017)
## Madam_Secretary 0.090*** (0.018)
## Scandal -0.025 (0.019)
## Alpha_House -0.061** (0.029)
## Constant 0.883*** (0.006)
## -----------------------------------------------
## Observations 3,657
## R2 0.007
## Adjusted R2 0.005
## Residual Std. Error 0.313 (df = 3651)
## F Statistic 5.009*** (df = 5; 3651)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Expressly Political Entertainment Programs with Registration as the Dependent Variable ###
coefplot::coefplot(Expressly_Political_Entertainment_Programs_Register_lm) + labs(title = "Coefficent Plot of Expressly Political\nEntertainment Programs by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Entertainment or Opinion Political News Programs") + theme_dark()
### Summary for Entertainment Programs that Focus on a Salient Political Issue with Registration as the Dependent Variable ###
stargazer(Entertainment_Programs_that_Focus_on_a_salient_Political_Issue_Register_lm , title = "Summary for Entertainment Programs that Focus on a Salient Political Issue and Registration" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for Entertainment Programs that Focus on a Salient Political Issue and Registration
## ===============================================
## Dependent variable:
## ---------------------------
## Register
## -----------------------------------------------
## The_Blacklist 0.029* (0.017)
## Criminal_Minds -0.055*** (0.015)
## NCIS 0.034** (0.015)
## Scorpion 0.008 (0.021)
## Judge_Judy -0.011 (0.016)
## Daredevil -0.044** (0.022)
## Blue_bloods 0.030* (0.017)
## Hawaii_Five_O 0.010 (0.021)
## Constant 0.885*** (0.006)
## -----------------------------------------------
## Observations 3,657
## R2 0.008
## Adjusted R2 0.005
## Residual Std. Error 0.313 (df = 3648)
## F Statistic 3.473*** (df = 8; 3648)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Entertainment Programs that Focus on a Salient Political Issue with Registration as the Dependent Variable ###
coefplot::coefplot(Entertainment_Programs_that_Focus_on_a_salient_Political_Issue_Register_lm) + labs(title = "Coefficent Plot of Entertainment Programs that\nFocus on a Salient Political Issue by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Entertainment Programs that Focus on a Salient Political Issue") + theme_dark()
### Summary for Apolitical Entertainment Programs with Registration as the Dependent Variable ###
stargazer(Apolitical_Entertainment_Programs_Register_lm , title = "Summary for apolitical Entertainment Programs and Registration" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for apolitical Entertainment Programs and Registration
## ==================================================================
## Dependent variable:
## ---------------------------
## Register
## ------------------------------------------------------------------
## Empire -0.001 (0.020)
## Modern_Family -0.005 (0.015)
## Sunday_Night_Football 0.011 (0.012)
## The_Simpsons -0.027 (0.022)
## Dancing_with_the_Stars 0.026* (0.016)
## Shark_Tank -0.001 (0.015)
## The_Voice -0.028* (0.015)
## Conan 0.004 (0.025)
## The_Big_Bang_Theory 0.014 (0.013)
## The_Tonight_Show_Starring_Jimmy_Fallon 0.005 (0.015)
## Constant 0.885*** (0.007)
## ------------------------------------------------------------------
## Observations 3,657
## R2 0.002
## Adjusted R2 -0.0005
## Residual Std. Error 0.314 (df = 3646)
## F Statistic 0.827 (df = 10; 3646)
## ==================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for Apolitical Entertainment Programs with Registration as the Dependent Variable ###
coefplot::coefplot(Apolitical_Entertainment_Programs_Register_lm) + labs(title = "Coefficent Plot of apolitical Entertainment\nPrograms by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Apolitical Entertainment Programs") + theme_dark()
### Summary for All Variables with Registration as the Dependent Variable ###
stargazer(All_Variables_Register_lm , title = "Summary for All Programs and Registration" , type = "text" , align = TRUE , no.space = TRUE , single.row = TRUE)
##
## Summary for All Programs and Registration
## ===================================================================
## Dependent variable:
## ---------------------------
## Register
## -------------------------------------------------------------------
## Twenty_Twenty -0.017 (0.017)
## CBS_Evening_News_with_Scott_Pelley 0.004 (0.017)
## Sixty_Minutes 0.033** (0.015)
## Face_the_Nation 0.004 (0.021)
## Meet_the_Press 0.005 (0.020)
## NBC_Nightly_News_with_Lester_Holt -0.014 (0.015)
## ABC_World_News_with_David_Muir 0.009 (0.016)
## Dateline_NBC 0.010 (0.015)
## PBS_News_Hour 0.002 (0.018)
## All_In_with_Chris_Hayes 0.037 (0.034)
## Hannity 0.035 (0.023)
## Jimmy_Kimmel_Live -0.015 (0.020)
## The_Kelly_File 0.005 (0.024)
## The_Nightly_Show_with_Larry_Wilmore 0.039 (0.039)
## Today 0.003 (0.016)
## Anderson_Cooper_Three_Hundred_and_Sixty 0.010 (0.017)
## CBS_This_Morning -0.005 (0.016)
## Hardball_with_Chris_Matthews -0.020 (0.027)
## On_the_Record_with_Greta_Van_Susteren 0.010 (0.024)
## The_Rachel_Maddow_Show 0.026 (0.026)
## Good_Morning_America 0.002 (0.015)
## Nancy_Grace -0.037 (0.027)
## Erin_Burnett_Outfromt -0.049 (0.032)
## The_O_Reilly_Factor 0.010 (0.021)
## House_of_Cards -0.004 (0.020)
## Game_of_Thrones 0.006 (0.018)
## Madam_Secretary 0.056*** (0.021)
## Scandal -0.004 (0.021)
## Alpha_House -0.066 (0.054)
## The_Blacklist 0.027 (0.019)
## Criminal_Minds -0.039** (0.016)
## NCIS 0.026* (0.016)
## Scorpion 0.006 (0.023)
## Judge_Judy -0.00000 (0.018)
## Daredevil 0.005 (0.030)
## Blue_bloods 0.021 (0.018)
## Hawaii_Five_O 0.012 (0.021)
## Empire -0.014 (0.022)
## Modern_Family -0.005 (0.016)
## Sunday_Night_Football -0.002 (0.012)
## The_Simpsons -0.040* (0.024)
## Dancing_with_the_Stars 0.008 (0.017)
## Shark_Tank -0.009 (0.016)
## The_Voice -0.040*** (0.015)
## Conan -0.034 (0.029)
## The_Big_Bang_Theory 0.001 (0.013)
## The_Tonight_Show_Starring_Jimmy_Fallon -0.001 (0.016)
## Constant 0.875*** (0.008)
## -------------------------------------------------------------------
## Observations 3,657
## R2 0.023
## Adjusted R2 0.010
## Residual Std. Error 0.313 (df = 3609)
## F Statistic 1.770*** (df = 47; 3609)
## ===================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot with Registration as the Dependent Variable ###
coefplot::coefplot (All_Variables_Register_lm) + labs(title = "Coefficent Plot of All\nPrograms by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Apolitical Entertainment Programs") + theme_dark()
Regression for the Programs Grouped Together with Turnout as the Dependent Variable:
We grouped the programs together as we did in the previous sections (by content same groups as before), but added the programs together rather than leaving them separate to see how the programs when grouped together affect turnout. To do this we added each group together as a data set, and then applied a linear regression to each group as we did before. We then grouped all of the groups together and ran linear regression on the “grouped groups” in oder to see how they covariate.
To make the plotting and summarise of the regression easier to read and visualize we shortened the longer detailed names to shorter more managable ones. Instead of using the word Vote in the name to denote that the regression is done with voting as the dependent variable we now use the letter V to mean the same thing and lm still denotes that the variable has been regressed. Traditional_Political_News_Programs is now News, Entertainment_or_Opinion_Political_News_Programs is now Opinion, Expressly_Political_Entertainment_Programs is now Entertainment, Entertainment_Programs_that_Focus_on_a_salient_Political_Issue is now Issue, Apolitical_Entertainment_Programs is now Apolitical, All_variables is now All programs.
## Creates a variable Vote for whether or not the respondent Voted in the 2016 election ###
anes_clean <- anes16 %>%
mutate(across (everything(), clean)) %>%
mutate(Vote = case_when(
V162034 == 2 ~ 0,
V162034 == 1 ~ 1))
### Regression for Traditional Political News Programs and Turnout Grouped ###
News_V <- as.data.frame(Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
News_V_lm <- lm(Vote ~ News_V , data = anes_clean)
### Regression for Entertainment or Opinion Political News Programs and Turnout Grouped ###
Opinion_V <- as.data.frame(All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Opinion_V_lm <- lm(Vote ~ Opinion_V , data = anes_clean)
### Regression for Entertainment Programs that are Expressly Political and Turnout Grouped ###
Entertainment_V <- as.data.frame (House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Entertainment_V_lm <- lm (Vote ~ Entertainment_V , data = anes_clean)
### Regression for Entertainment Programs that are not Expressly Political but Focus on a Salient Political Issue and Turnout Grouped ###
Issue_V <- as.data.frame(The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Issue_V_lm <- lm(Vote ~ Issue_V, data = anes_clean)
### Regression for Entertainment Programs with little to No Political Content and Turnout Grouped ###
Apolitical_V <- as.data.frame(Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Apolitical_V_lm <- lm(Vote ~ Apolitical_V , data = anes_clean)
### Regression for All Variables and Turnout Grouped ###
All_Programs_V <- as.data.frame(Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour + All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor + House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House + The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O + Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
All_Programs_V_lm <- lm(Vote ~ All_Programs_V , data = anes_clean)
### Regression for All Grouped Variables Grouped and Turnout ###
All_Groups_V <- as.data.frame(
News_V + Opinion_V + Entertainment_V +
Issue_V + Apolitical_V ) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
All_Groups_V_lm <- lm(Vote ~ All_Groups_V , data = anes_clean)
The Plots and Summaries for the Regression Performed on the Grouped Programs with Turnout as the Dependent Variable:
We utilized the stargazer function from the Stargazer package to summarize the findings from the regression performed on the Grouped programs with turnout as the dependent variable. We then used the multiplot function from the Coefplot package to visualize the regression performed on the programs with turnout as the dependent variable.
### Summary for all of the Grouped Programs with Turnout as the Dependent Variable ###
stargazer( News_V_lm , Opinion_V_lm , Entertainment_V_lm , Issue_V_lm , Apolitical_V_lm , All_Programs_V_lm , All_Groups_V_lm ,
title = "Summary for Each Group of Programs and Turnout " , type = "text" , align = TRUE , no.space = TRUE, intercept.top = TRUE, intercept.bottom = FALSE)
##
## Summary for Each Group of Programs and Turnout
## ==============================================================================================
## Dependent variable:
## --------------------------------------------------------------
## Vote
## (1) (2) (3) (4) (5) (6) (7)
## ----------------------------------------------------------------------------------------------
## Constant 0.987*** 0.984*** 0.987*** 0.986*** 0.985*** 0.986*** 0.986***
## (0.003) (0.003) (0.003) (0.003) (0.004) (0.004) (0.004)
## News_V -0.001
## (0.001)
## Opinion_V 0.001
## (0.001)
## Entertainment_V -0.002
## (0.003)
## Issue_V -0.001
## (0.002)
## Apolitical_V 0.0002
## (0.002)
## All_Programs_V -0.00002
## (0.0005)
## All_Groups_V -0.00002
## (0.0005)
## ----------------------------------------------------------------------------------------------
## Observations 2,435 2,435 2,435 2,435 2,435 2,435 2,435
## R2 0.0001 0.0003 0.0002 0.0001 0.00001 0.00000 0.00000
## Adjusted R2 -0.0003 -0.0001 -0.0002 -0.0004 -0.0004 -0.0004 -0.0004
## Residual Std. Error (df = 2433) 0.119 0.119 0.119 0.119 0.119 0.119 0.119
## F Statistic (df = 1; 2433) 0.201 0.732 0.493 0.148 0.013 0.001 0.001
## ==============================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for all of the Grouped Programs with Turnout as the Dependent Variable ###
coefplot::multiplot (News_V_lm , Opinion_V_lm , Entertainment_V_lm , Issue_V_lm , Apolitical_V_lm , All_Programs_V_lm , All_Groups_V_lm ) + labs(title = "Coefficent Plot of Each\nGroup of Programs by Turnout" , caption = "Data from the American National Election Survey 2016", x = "Turnout" , y = "Programs Grouped by Category") + theme_dark()
Regression for the Programs Grouped Together with Registration as the Dependent Variable:
This section is identical to the section on the linear regression performed on the TV programs grouped with turnout/vote as the dependent variable except with registration as the dependent variable.
We grouped the programs together as we did in the previous sections (by content same groups as before), but added the programs together rather than leaving them separate to see how the programs when grouped together affect turnout to do this we applied a linear regression to each group as we did before. We then grouped the groups together to see how the groups when grouped together affect turnout.
To make the plotting and summarise of the regression easier to read and visualize we shortened the longer detailed names to shorter more managable ones. Instead of using the word Registration in the name to denote that the regression is done with voting as the dependent variable we now use the letter R to mean the same thing and lm still denotes that the variable has been regressed. Traditional_Political_News_Programs_Register is now News, Entertainment_or_Opinion_Political_News_Programs is now Opinion, Expressly_Political_Entertainment_Programs is now Entertainment, Entertainment_Programs_that_Focus_on_a_salient_Political_Issue is now Issue, Apolitical_Entertainment_Programs_Register is now Apolitical, All_variables is now All programs.
### Creates the variable registration for whether or not the respondent was Registered to Vote prior to the 2016 election ###
anes_clean <- anes16 %>%
mutate(across (everything(), clean)) %>%
mutate(Register = case_when(
V161011 == 2 ~ 0,
V161011 == 1 ~ 1))
### Regression for Traditional Political News Programs and Registration Status Grouped ###
News_R <- as.data.frame(Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
News_R_lm <- lm(Register ~ News_R , data = anes_clean)
### Regression for Entertainment or Opinion Political News Programs and Registration Status Grouped ###
Opinion_R <- as.data.frame (All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Opinion_R_lm <- lm (Register ~ Opinion_R , data = anes_clean)
### Regression for Entertainment Programs that are Expressly Political and Registration Status Grouped ###
Entertainment_R <- as.data.frame(House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Entertainment_R_lm <- lm(Register ~ Entertainment_R , data = anes_clean)
### Regression for Entertainment Programs that are not Expressly Political but Focus on a salient Political Issue and Registration Status Grouped ###
Issue_R <- as.data.frame( The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Issue_R_lm <- lm(Register ~ Issue_R , data = anes_clean)
### Regression for Entertainment Programs with little to No Political Content and Registration Status Grouped ###
Apolitical_R <- as.data.frame(Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
Apolitical_R_lm <- lm(Register ~ Apolitical_R , anes_clean)
### Regression for All Variables and Registration Status Grouped ###
All_Programs_R <- as.data.frame(Twenty_Twenty + CBS_Evening_News_with_Scott_Pelley + Sixty_Minutes + Face_the_Nation + Meet_the_Press + NBC_Nightly_News_with_Lester_Holt + ABC_World_News_with_David_Muir + Dateline_NBC + PBS_News_Hour + All_In_with_Chris_Hayes + Hannity + Jimmy_Kimmel_Live + The_Kelly_File + The_Nightly_Show_with_Larry_Wilmore + Today + Anderson_Cooper_Three_Hundred_and_Sixty + CBS_This_Morning + Hardball_with_Chris_Matthews + On_the_Record_with_Greta_Van_Susteren + The_Rachel_Maddow_Show + Good_Morning_America + Nancy_Grace + Erin_Burnett_Outfromt + The_O_Reilly_Factor + House_of_Cards + Game_of_Thrones + Madam_Secretary + Scandal + Alpha_House + The_Blacklist + Criminal_Minds + NCIS + Scorpion + Judge_Judy + Daredevil + Blue_bloods + Hawaii_Five_O + Empire + Modern_Family + Sunday_Night_Football + The_Simpsons + Dancing_with_the_Stars + Shark_Tank + The_Voice + Conan + The_Big_Bang_Theory + The_Tonight_Show_Starring_Jimmy_Fallon) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
All_Programs_R_lm <- lm(Register ~ All_Programs_R , data = anes_clean)
### Regression for All Variables Grouped Grouped Registration Status ###
All_Groups_R <- as.data.frame (News_R + Opinion_R + Entertainment_R + Issue_R + Apolitical_R) %>%
rename(count = 1) %>%
mutate(count = ifelse(count <0, NA, count)) %>% unlist()
All_Groups_R_lm <- lm(Register ~ All_Groups_R , data = anes_clean)
The Plots and Summaries for the Regression Performed on the Grouped Programs with Registration as the Dependent Variable:
We utilized the stargazer function from the Stargazer package to summarize the findings from the regression performed on the Grouped programs with registration as the dependent variable. We then used the multiplot function from the Coefplot package to visualize the regression performed on the programs with registration as the dependent variable.
### Summary for all of the Grouped Programs with Turnout as the Dependent Variable ###
stargazer(News_R_lm , Opinion_R_lm , Entertainment_R_lm , Issue_R_lm , Apolitical_R_lm , All_Programs_R_lm , All_Groups_R_lm ,
title = "Summary for Each Group of Programs and Registration" , type = "text" , align = TRUE , no.space = TRUE , intercept.top = TRUE, intercept.bottom = FALSE)
##
## Summary for Each Group of Programs and Registration
## ==============================================================================================
## Dependent variable:
## --------------------------------------------------------------
## Register
## (1) (2) (3) (4) (5) (6) (7)
## ----------------------------------------------------------------------------------------------
## Constant 0.881*** 0.879*** 0.886*** 0.880*** 0.904*** 0.875*** 0.875***
## (0.007) (0.007) (0.006) (0.007) (0.008) (0.009) (0.009)
## News_R 0.006**
## (0.003)
## Opinion_R 0.007**
## (0.003)
## Entertainment_R 0.012*
## (0.007)
## Issue_R 0.011***
## (0.004)
## Apolitical_R -0.008**
## (0.003)
## All_Programs_R 0.002**
## (0.001)
## All_Groups_R 0.002**
## (0.001)
## ----------------------------------------------------------------------------------------------
## Observations 3,235 3,235 3,235 3,235 3,235 3,235 3,235
## R2 0.001 0.002 0.001 0.002 0.002 0.001 0.001
## Adjusted R2 0.001 0.001 0.001 0.002 0.001 0.001 0.001
## Residual Std. Error (df = 3233) 0.311 0.311 0.311 0.311 0.311 0.311 0.311
## F Statistic (df = 1; 3233) 4.580** 5.575** 2.816* 7.286*** 5.059** 4.436** 4.436**
## ==============================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
### Coefficient Plot for all of the Grouped Programs with Turnout as the Dependent Variable ###
coefplot::multiplot(News_R_lm , Opinion_R_lm , Entertainment_R_lm , Issue_R_lm , Apolitical_R_lm , All_Programs_R_lm , All_Groups_R_lm) + labs(title = "Coefficent Plot of Each\nGroup of Programs by Registration" , caption = "Data from the American National Election Survey 2016", x = "Registration" , y = "Programs Grouped by Category") + theme_dark()