Skip to contents

Extracted from the "cheating-replication.dta" data file with permission by the authors, Benjamin Nyblade and Steven Reed. The Stata data file provided by the authors included many constructed variables that have been omitted. Within R, these can be easily re-contructed by users.

Usage

data(cheating)

Format

data.frame: 16623 obs. on 27 variables

Details

Special thanks to NyBlade and Reed for permission to repackage this data. Also special thanks to them for creating an especially transparent variable naming scheme.

The data set includes many columns for variables that can easily be re-constructed from the columns that are provided here. While Stata users might need to manually create 'dummy variables' and interactions, R users generally do not do that manually.

These variables from the original data set were omitted:

Dummy variables for the year variable: c("yrd1", "yrd2", ..., "yrd17", "yrd18")

Dummy variables for the ku variable: c("ku1", "ku2", ..., "ku141", "ku142")

Constructed product variables: c("actualratiosq", "viabsq", "viab_candcamp_divm", "viab_candothercamp_divm", "viabsq_candcamp_divm", "viabsq_candothercamp_divm", "absviab_candcamp", "absviab_candothercamp", "absviab_candcamp_divm", "absviab_candothercamp_divm", "viabsq_candcamp", "viabsq_candothercamp", "viab_candcamp", "viab_candothercamp", "candothercamp_divm", "candcamp_divm", "candcampminusm", "candothercampminusm", "predratiosq", "absviab")

Mean centered variables: constr2 <- c("viab_candcampminusm", "viab_candothercampminusm", "viabsq_candothercampminusm", "viabsq_candcampminusm")

In the end, we are left with these variables:

[1] "ku" [2] "prefecture" [3] "dist" [4] "year" [5] "yr" [6] "cdnr" [7] "jiban" [8] "cheating" [9] "looting" [10] "actualratio" [11] "viab" [12] "inc" [13] "cons" [14] "ur" [15] "newcand" [16] "jwins" [17] "cons_cwins" [18] "oth_cwins" [19] "camp" [20] "fleader" [21] "incablast" [22] "predratio" [23] "m" [24] "candcamp" [25] "candothercamp" [26] "kunocheat" [27] "kunoloot"

References

Benjamin Nyblade and Steven Reed, "Who Cheats? Who Loots? Political Competition and Corruption in Japan, 1947-1993." American Journal of Political Science 52(4): 926-41. October 2008.

Author

Paul E. Johnson pauljohn@ku.edu, on behalf of Benjamin Nyblade and Steven Reed

Examples

require(rockchalk)
data(cheating)

table1model2 <- glm(cheating ~ viab + I(viab^2) + inc + cons + ur
+ newcand + jwins + cons_cwins + oth_cwins, family = binomial(link
= "logit"), data = cheating)

predictOMatic(table1model2)
#> $viab
#>         viab       inc      cons       ur   newcand    jwins cons_cwins
#> 1 -0.5000000 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 2 -0.2150552 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 3  0.1410797 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 4  0.3884473 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 5  0.5000000 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#>   oth_cwins         fit
#> 1 0.9028964 0.005269946
#> 2 0.9028964 0.009585624
#> 3 0.9028964 0.012889333
#> 4 0.9028964 0.011809048
#> 5 0.9028964 0.010492609
#> 
#> $inc
#>         viab inc      cons       ur   newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562   1 0.5272481 2.538259 0.1176095 3.643262   1.826139 0.9028964
#> 2 0.07121562   0 0.5272481 2.538259 0.1176095 3.643262   1.826139 0.9028964
#>          fit
#> 1 0.01077975
#> 2 0.01605494
#> 
#> $cons
#>         viab       inc cons       ur   newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585    1 2.538259 0.1176095 3.643262   1.826139 0.9028964
#> 2 0.07121562 0.5990585    0 2.538259 0.1176095 3.643262   1.826139 0.9028964
#>          fit
#> 1 0.02469779
#> 2 0.00595655
#> 
#> $ur
#>         viab       inc      cons ur   newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585 0.5272481  2 0.1176095 3.643262   1.826139 0.9028964
#> 2 0.07121562 0.5990585 0.5272481  3 0.1176095 3.643262   1.826139 0.9028964
#> 3 0.07121562 0.5990585 0.5272481  4 0.1176095 3.643262   1.826139 0.9028964
#> 4 0.07121562 0.5990585 0.5272481  1 0.1176095 3.643262   1.826139 0.9028964
#>           fit
#> 1 0.011436713
#> 2 0.013790875
#> 3 0.016621475
#> 4 0.009480554
#> 
#> $newcand
#>         viab       inc      cons       ur newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259       0 3.643262   1.826139 0.9028964
#> 2 0.07121562 0.5990585 0.5272481 2.538259       1 3.643262   1.826139 0.9028964
#>          fit
#> 1 0.01290339
#> 2 0.01089724
#> 
#> $jwins
#>         viab       inc      cons       ur   newcand jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     0   1.826139 0.9028964
#> 2 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     1   1.826139 0.9028964
#> 3 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     2   1.826139 0.9028964
#> 4 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     6   1.826139 0.9028964
#> 5 0.07121562 0.5990585 0.5272481 2.538259 0.1176095    17   1.826139 0.9028964
#>           fit
#> 1 0.014222225
#> 2 0.013772359
#> 3 0.013336529
#> 4 0.011725246
#> 5 0.008221063
#> 
#> $cons_cwins
#>         viab       inc      cons       ur   newcand    jwins cons_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          0
#> 2 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          0
#> 3 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          0
#> 4 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          3
#> 5 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262         25
#>   oth_cwins         fit
#> 1 0.9028964 0.014468533
#> 2 0.9028964 0.014468533
#> 3 0.9028964 0.014468533
#> 4 0.9028964 0.011601730
#> 5 0.9028964 0.002270248
#> 
#> $oth_cwins
#>         viab       inc      cons       ur   newcand    jwins cons_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 2 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 3 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 4 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 5 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#>   oth_cwins          fit
#> 1         0 0.0168034217
#> 2         0 0.0168034217
#> 3         0 0.0168034217
#> 4         1 0.0122684352
#> 5        14 0.0001959623
#> 

predictOMatic(table1model2, interval = "confidence")
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> rockchalk:::predCI: model's predict method does not return an interval.
#>  We will improvize with a Wald type approximation to the confidence interval 
#> $viab
#>         viab       inc      cons       ur   newcand    jwins cons_cwins
#> 1 -0.5000000 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 2 -0.2150552 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 3  0.1410797 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 4  0.3884473 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 5  0.5000000 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#>   oth_cwins         fit         lwr         upr
#> 1 0.9028964 0.005269946 0.002959313 0.009367772
#> 2 0.9028964 0.009585624 0.006928724 0.013247754
#> 3 0.9028964 0.012889333 0.009824098 0.016894640
#> 4 0.9028964 0.011809048 0.008716433 0.015981242
#> 5 0.9028964 0.010492609 0.007034724 0.015623456
#> 
#> $inc
#>         viab inc      cons       ur   newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562   1 0.5272481 2.538259 0.1176095 3.643262   1.826139 0.9028964
#> 2 0.07121562   0 0.5272481 2.538259 0.1176095 3.643262   1.826139 0.9028964
#>          fit         lwr        upr
#> 1 0.01077975 0.007746345 0.01498307
#> 2 0.01605494 0.011015395 0.02334564
#> 
#> $cons
#>         viab       inc cons       ur   newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585    1 2.538259 0.1176095 3.643262   1.826139 0.9028964
#> 2 0.07121562 0.5990585    0 2.538259 0.1176095 3.643262   1.826139 0.9028964
#>          fit         lwr         upr
#> 1 0.02469779 0.018032061 0.033742888
#> 2 0.00595655 0.003816553 0.009285292
#> 
#> $ur
#>         viab       inc      cons ur   newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585 0.5272481  2 0.1176095 3.643262   1.826139 0.9028964
#> 2 0.07121562 0.5990585 0.5272481  3 0.1176095 3.643262   1.826139 0.9028964
#> 3 0.07121562 0.5990585 0.5272481  4 0.1176095 3.643262   1.826139 0.9028964
#> 4 0.07121562 0.5990585 0.5272481  1 0.1176095 3.643262   1.826139 0.9028964
#>           fit         lwr        upr
#> 1 0.011436713 0.008483905 0.01540128
#> 2 0.013790875 0.010439343 0.01819862
#> 3 0.016621475 0.012034408 0.02291641
#> 4 0.009480554 0.006523356 0.01375976
#> 
#> $newcand
#>         viab       inc      cons       ur newcand    jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259       0 3.643262   1.826139 0.9028964
#> 2 0.07121562 0.5990585 0.5272481 2.538259       1 3.643262   1.826139 0.9028964
#>          fit         lwr        upr
#> 1 0.01290339 0.009712292 0.01712484
#> 2 0.01089724 0.006002356 0.01970474
#> 
#> $jwins
#>         viab       inc      cons       ur   newcand jwins cons_cwins oth_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     0   1.826139 0.9028964
#> 2 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     1   1.826139 0.9028964
#> 3 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     2   1.826139 0.9028964
#> 4 0.07121562 0.5990585 0.5272481 2.538259 0.1176095     6   1.826139 0.9028964
#> 5 0.07121562 0.5990585 0.5272481 2.538259 0.1176095    17   1.826139 0.9028964
#>           fit         lwr        upr
#> 1 0.014222225 0.010179367 0.01983857
#> 2 0.013772359 0.010113299 0.01873024
#> 3 0.013336529 0.009975115 0.01781030
#> 4 0.011725246 0.008614631 0.01594100
#> 5 0.008221063 0.003834457 0.01753759
#> 
#> $cons_cwins
#>         viab       inc      cons       ur   newcand    jwins cons_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          0
#> 2 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          0
#> 3 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          0
#> 4 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262          3
#> 5 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262         25
#>   oth_cwins         fit          lwr        upr
#> 1 0.9028964 0.014468533 0.0107887224 0.01937886
#> 2 0.9028964 0.014468533 0.0107887224 0.01937886
#> 3 0.9028964 0.014468533 0.0107887224 0.01937886
#> 4 0.9028964 0.011601730 0.0085679384 0.01569274
#> 5 0.9028964 0.002270248 0.0003851442 0.01325968
#> 
#> $oth_cwins
#>         viab       inc      cons       ur   newcand    jwins cons_cwins
#> 1 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 2 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 3 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 4 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#> 5 0.07121562 0.5990585 0.5272481 2.538259 0.1176095 3.643262   1.826139
#>   oth_cwins          fit          lwr        upr
#> 1         0 0.0168034217 1.240634e-02 0.02272307
#> 2         0 0.0168034217 1.240634e-02 0.02272307
#> 3         0 0.0168034217 1.240634e-02 0.02272307
#> 4         1 0.0122684352 9.180701e-03 0.01637750
#> 5        14 0.0001959623 4.493889e-06 0.00847606
#> 

## The publication used "rare events logistic", which I'm not bothering
## with here because I don't want to invoke additional imported packages.
## But the ordinary logit results are proof of concept.