ajps: Gaines and Kuklinski (2011) AJPS data

Description Usage Format Details Source See Also Examples

Description

Subset of data from Gaines and Kuklinski (2011)

Usage

1

Format

tr

The treatment indicator, where 1=treatment, 2=control, 3=chose treatment, 4=chose control.

therm.obama

A “feeling thermometer” toward John McCain.

therm.mccain

A “feeling thermometer” toward Barack Obama.

pid

An indicator of party identification, where -1=Republican, 0=Independent, 1=Democrat.

Details

This dataset contains a subset of variables, extracted from the dataset used by Gaines and Kuklinski (2011).

Source

Brian J. Gaines and James H. Kuklinski, (2011), "Experimental Estimation of Heterogeneous Treatment Effects Related to Self-Selection," American Journal of Political Science 55(3): 724-736.

See Also

estimate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
data(ajps)

# replicate Gaines and Kuklinski (2011) Table 2
pmean <- function(x) sprintf("%0.1f", mean(x))
cbind(
  # Democrats
  aggregate(cbind(therm.mccain, therm.obama) ~ tr, 
            data = ajps[ajps$pid == 1, ], FUN = pmean)[, 1:3],
  n_dem = aggregate(therm.obama ~ tr, 
                    data = ajps[ajps$pid == 1, ], FUN = length)[, 2],
  # Republicans
  aggregate(cbind(therm.mccain, therm.obama) ~ tr, 
            data = ajps[ajps$pid == -1, ], FUN = pmean)[, 2:3],
  n_rep = aggregate(therm.obama ~ tr, 
                    data = ajps[ajps$pid == -1, ], FUN = length)[, 2]
)

# effects for McCain among Democrats
with(ajps[ajps$pid == 1, ], {
  estimate(rand = tr %in% 1:2, tr = tr %in% c(1,3), y = therm.mccain)
})
# effects for McCain among Republicans
with(ajps[ajps$pid == -1, ], {
  estimate(rand = tr %in% 1:2, tr = tr %in% c(1,3), y = therm.mccain)
})

# effects for Obama among Democrats
with(ajps[ajps$pid == 1, ], {
  estimate(rand = tr %in% 1:2, tr = tr %in% c(1,3), y = therm.obama)
})
# effects for Obama among Republicans
with(ajps[ajps$pid == -1, ], {
  estimate(rand = tr %in% 1:2, tr = tr %in% c(1,3), y = therm.obama)
})


Search within the GK2011 package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.