Rename V161086 clinton and recode to get rid of missing values and non-responses.

Using the 2016 ANES, replicate the analysis with feelings towards Trump using feelings towards Hillary Clinton. The variable for Clinton is V161086 and use the same 8 predictor variables.



setwd("C:/QSSD/Exercises/Chapter 13 - Exercises/")
getwd()
[1] "C:/QSSD/Exercises/Chapter 13 - Exercises"
library(foreign)
nes <- read.dta("anes_timeseries_2016_Stata12.dta")
Warning in read.dta("anes_timeseries_2016_Stata12.dta"): value labels
('V161029b') for 'V161029b' are missing
Hillary Clinton feeling thermometer
class(nes$V161086)
[1] "numeric"
table(nes$V161086)

-99 -88 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
36 2 947 81 69 24 17 20 4 1 9 2 16 2 2 1 4 332
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
33 14 6 2 16 1 1 2 2 5 1 3 3 3 257 24 10 7
34 35 36 38 39 40 41 42 43 44 45 46 49 50 51 52 53 55
1 6 3 1 6 228 20 6 4 2 6 1 2 195 15 4 2 8
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
1 2 1 1 373 33 10 3 3 10 5 2 1 10 414 31 13 4
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
4 22 6 4 5 3 25 4 3 1 11 434 13 13 3 3 33 3
92 93 94 95 96 97 98 99 100
4 4 1 18 4 8 13 11 232

library(car)
Loading required package: carData
nes$clinton <- recode(nes$V161086, "-99:-88=NA")
table(nes$clinton)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
947 81 69 24 17 20 4 1 9 2 16 2 2 1 4 332 33 14
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
6 2 16 1 1 2 2 5 1 3 3 3 257 24 10 7 1 6
36 38 39 40 41 42 43 44 45 46 49 50 51 52 53 55 56 57
3 1 6 228 20 6 4 2 6 1 2 195 15 4 2 8 1 2
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
1 1 373 33 10 3 3 10 5 2 1 10 414 31 13 4 4 22
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
6 4 5 3 25 4 3 1 11 434 13 13 3 3 33 3 4 4
94 95 96 97 98 99 100
1 18 4 8 13 11 232

Social Work & Human Services

You might also like to view...

What percentage of respondents are not afraid to walk alone at night?



A. 0.639
B. 36.1
C. 63.9
D. 1,274

Social Work & Human Services

involves the permanent movement from one country to another

What will be an ideal response?

Social Work & Human Services

One of characteristic of post-modern social movements is that

a. they frequently composed of open, but tightly structured, networks. b. they are concerned with self-determination rather than dominance. c. satisfied with reality as it is. d. they are not seeking to contest the very foundations of society.

Social Work & Human Services

The Microsystem includes

A) individuals B) groups C) family D) communities

Social Work & Human Services