eiread
is the command that pulls quantities of interest from the
ei
object. The command returns a list of quantities of interest
requested by the user.
Arguments
- ei.object
An
ei
object from the functionei
.- ...
A list of quantities of interest for
eiread()
to return. See values below.
Value
- betab
\(p\) x \(1\) point estimate of \(\beta_i^b\) based on its mean posterior. See section 8.2
- betaw
\(p\) x \(1\) point estimate of \(\beta_i^w\) based on its mean posterior. See section 8.2
- sbetab
\(p\) x \(1\) standard error for the estimate of \(\beta_i^b\), based on the standard deviation of its posterior. See section 8.2
- sbetaw
\(p\) x \(1\) standard error for the estimate of \(\beta_i^w\), based on the standard deviation of its posterior. See section 8.2
- phi
Maximum posterior estimates of the CML
- psisims
Matrix of random simulations of \(\psi\). See section 8.2
- bounds
\(p\) x \(4\): bounds on \(\beta_i^b\) and \(\beta_i^w\), lowerB ~ upperB ~ lowerW ~ upperW. See Chapter 5.
- abounds
\(2\) x \(2\): aggregate bounds rows:lower, upper; columns: betab, betaw. See Chapter 5.
- aggs
Simulations of district-level quantities of interest \(\hat{B^b}\) and \(\hat{B^w}\). See Section 8.3.
- maggs
Point estimate of 2 district-level parameters, \(\hat{B^b}\) and \(\hat{B^w}\) based on the mean of aggs. See Section 8.3.
- VCaggs
Variance matrix of 2 district-level parameters, \(\hat{B^b}\) and \(\hat{B^w}\). See Section 8.3.
- CI80b
\(p\) x \(2\): lower~upper \(80\%\) confidence intervals for \(\beta_i^b\). See section 8.2.
- CI80w
\(p\) x \(2\): lower~upper \(80\%\) confidence intervals for \(\beta_i^w\). See section 8.2.
- eaggbias
Regressions of estimated \(\beta_i^b\) and \(\beta_i^w\) on a constant term and \(X_i\).
- goodman
Goodman's Regression. See Section 3.1
numeric values
References
Gary King (1997). A Solution to the Ecological Inference Problem. Princeton: Princeton University Press.
Examples
data(sample_ei)
formula <- t ~ x
dbuf <- ei(formula = formula, total = "n", data = sample_ei)
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 0.5.
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 3.
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 5.
#> ℹ Running 2x2 ei
#> ℹ Maximizing likelihood for `erho` = 0.1.
#> ℹ Running 2x2 ei
#> ✔ Running 2x2 ei [2ms]
#>
#> ⠙ Beginning importance sampling.
#> ✔ Beginning importance sampling. [1.7s]
#>
eiread(dbuf, "phi")
#> [1] -1.1606 0.8264 -2.1411 -1.8074 0.0316 0.0000 0.0000
eiread(dbuf, "betab", "betaw")
#> $betab
#> [1] 0.1914 0.1367 0.1992 0.2943 0.1454 0.1773 0.1043 0.0994 0.2180 0.2240
#> [11] 0.2050 0.2385 0.1858 0.1986 0.2257 0.2015 0.2888 0.1674 0.1489 0.1009
#> [21] 0.3071 0.2046 0.2177 0.2076 0.4071 0.1550 0.1785 0.4111 0.2128 0.1998
#> [31] 0.2208 0.1865 0.1739 0.2117 0.2080 0.1663 0.2160 0.3841 0.2289 0.2812
#> [41] 0.1956 0.1900 0.2167 0.1014 0.1167 0.1536 0.2155 0.2011 0.1234 0.1312
#> [51] 0.2135 0.1782 0.2195 0.2185 0.2299 0.1752 0.2281 0.2474 0.2811 0.2022
#> [61] 0.2129 0.1376 0.2359 0.1836 0.1226 0.1632 0.1820 0.3809 0.2247 0.0382
#> [71] 0.2800 0.1570 0.1992 0.1838 0.3081
#>
#> $betaw
#> [1] 0.6914 0.6694 0.6222 0.8743 0.5549 0.3716 0.5218 0.5600 0.7853 0.9068
#> [11] 0.5830 0.9270 0.5931 0.7391 0.7636 0.7086 0.7004 0.7061 0.6986 0.6935
#> [21] 0.8936 0.8748 0.8118 0.7177 0.8110 0.6351 0.5649 0.9455 0.7424 0.7645
#> [31] 0.7693 0.6979 0.7171 0.9281 0.7812 0.5871 0.6774 0.7839 0.7202 0.8004
#> [41] 0.6488 0.7064 0.7301 0.6709 0.5450 0.4757 0.7413 0.7707 0.6894 0.6363
#> [51] 0.8899 0.6593 0.7598 0.7412 0.8853 0.6790 0.8553 0.7763 0.8386 0.7110
#> [61] 0.7222 0.6766 0.7341 0.5893 0.6112 0.6692 0.5348 0.8695 0.7281 0.4989
#> [71] 0.7291 0.7132 0.6799 0.4652 0.9738
#>