RxCEcolInf-package: RxCEcolInf

Description Details Author(s) References Examples

Description

Fits the R x C ecological inference model described in Greiner and Quinn (2009). Allows the inclusion of survey information.

Details

Package: RxCEcolInf
Type: Package
Version: 0.1-1
Date: 2009-04-14
License:

The user should place the data from the contingency tables into a dataframe, each line of which represents one table. The function Tune should be called first; this will tune the markov chain monte carlo algorithm used to fit the model. The user feeds the results from Tune into Analyze, which produces the results. Both Tune and Analyze are called using a string that resembles the R formula interface. If a simple random sample is available from certain contingency tables, the user may incorporate this survey using TuneWithExitPoll and AnalyzeWithExitPoll.

Author(s)

D. James Greiner, Paul D. Baines, \& Kevin M. Quinn

Maintainer: Kevin M. Quinn <kquinn@fas.harvard.edu>

References

D. James Greiner \& Kevin M. Quinn. 2009. “R x C Ecological Inference: Bounds, Correlations, Flexibility, and Transparency of Assumptions.” J.R. Statist. Soc. A 172:67-81.

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
35
36
37
38
39
40
41
42
43
44
## Not run: 
library(RxCEcolInf)
data(stlouis)
Tune.stlouis <- Tune("Bosley, Roberts, Ribaudo, Villa, NoVote ~ bvap, ovap",
                     data = stlouis,
                     num.iters = 10000,
                     num.runs = 15)
Chain1.stlouis <- Analyze("Bosley, Roberts , Ribaudo, 
                          Villa, NoVote ~ bvap, ovap",
                          rho.vec = Tune.stlouis$rhos,
                          data = stlouis,
                          num.iters = 1500000,
                          burnin = 150000,
                          save.every = 1500,
                          print_every = 15000,
                          debug = 1,
                          keepNNinternals = 100,
                          keepTHETAS = 100)
Chain2.stlouis <- Analyze("Bosley, Roberts , Ribaudo, Villa, 
                          NoVote ~ bvap, ovap",
                          rho.vec = Tune.stlouis$rhos,
                          data = stlouis,
                          num.iters = 1500000,
                          burnin = 150000,
                          save.every = 1500,
                          print_every = 15000,
                          debug = 1,
                          keepNNinternals = 100,
                          keepTHETAS = 100)
Chain3.stlouis <- Analyze("Bosley, Roberts , Ribaudo, Villa, 
	                  NoVote ~ bvap, ovap",
                          rho.vec = Tune.stlouis$rhos,
                          data = stlouis,
                          num.iters = 1500000,
                          burnin = 150000,
                          save.every = 1500,
                          print_every = 15000,
                          debug = 1,
                          keepNNinternals = 100,
                          keepTHETAS = 100)
stlouis.MCMClist <- mcmc.list(Chain1.stlouis, Chain2.stlouis,
Chain3.stlouis)

## End(Not run)

RxCEcolInf documentation built on Nov. 6, 2021, 5:07 p.m.