AbortionAmbivalence.RdData about attitudes towards abortion policy in the US. Cross-section data from the US General Social Survey 1982 with oversample of African American respondents.
data("AbortionAmbivalence")A data frame containing 1860 observations on 20 variables.
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if the woman's own health is seriously endangered by the pregnancy?
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if she became pregnant as a result of rape?
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if there is a strong chance of serious defect in the baby?
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if the family has a very low income and cannot afford any more children?
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if she is married and does not want any more children?
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if she is not married and does not want to marry the man?
factor. Answer to the question: Please tell me whether or not you think it should be possible for a pregnant woman to obtain a legal abortion if the woman wants it for reason?
factor indicating ethnicity.
Is the individual African-American ("afam") or not ("other")?
factor indicating gender.
factor indicating religious preference ("catholic" or
"other").
Religious intensity as coded by Alvarez and Brehm (1995).
Religious intensity in an alternative coding suggested by Altman and McDonald (1995).
Numeric coding of frequency of attending church.
factor. Answer to the question: Do you understand what the Equal Rights Amendment (ERA) means?
Intensity of support for ERA.
Number of arguments in favor of abortion named by the subject.
Number of arguments against abortion named by the subject.
Numeric coding of subjective importance of abortion issue.
Numeric coding of self-assessment of information on abortion issue available to the subject.
Numeric coding of subjective firmness of opinion on abortion.
The data were prepared and analyzed by Alvarez and Brehm (1995). A detailed discussion of the variables is provided in their Appendix A and the model is developed in their Section 3.
The data were reanalyzed by Altman and McDonald (2003) with focus on numerical accuracy and by Keele and Park (2006) with focus on interpretability.
Altman M, McDonald MP (2003). “Replication with Attention to Numerical Accuracy.” Political Analysis, 11, 302–307.
Alvarez RM, Brehm J (1995). “American Ambivalence towards Abortion Policy: Development of a Heteroskedastic Probit Model of Competing Values.” American Journal of Political Science, 39(4), 1055–1082.
Keele LJ, Park DK (2006). Ambivalent about Ambivalence: A Re-Examination of Heteroskedastic Probit Models. Unpublished manuscript.
data("AbortionAmbivalence")
## first model for mother's health
ab_health <- hetglm(
health ~ ethnicity + gender + religion + religiousness + church + erameans + erasupport |
pros * cons + importance + information + firmness, data = AbortionAmbivalence)
summary(ab_health)
#>
#> Call:
#> hetglm(formula = health ~ ethnicity + gender + religion + religiousness +
#> church + erameans + erasupport | pros * cons + importance + information +
#> firmness, data = AbortionAmbivalence)
#>
#> Deviance residuals:
#> Min 1Q Median 3Q Max
#> -3.8070 0.1287 0.2870 0.4568 1.0023
#>
#> Coefficients (binomial model with probit link):
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) 2.54783 0.50063 5.089 3.59e-07 ***
#> ethnicityafam -0.51181 0.16059 -3.187 0.001437 **
#> gendermale -0.07924 0.12267 -0.646 0.518342
#> religioncatholic -0.52051 0.15352 -3.390 0.000698 ***
#> religiousness -0.39103 0.21914 -1.784 0.074361 .
#> church -1.03817 0.28450 -3.649 0.000263 ***
#> erameansyes -0.01783 0.19842 -0.090 0.928395
#> erasupport 0.32614 0.20229 1.612 0.106914
#>
#> Latent scale model coefficients (with log link):
#> Estimate Std. Error z value Pr(>|z|)
#> pros -0.139936 0.083166 -1.683 0.09245 .
#> cons 0.168879 0.095989 1.759 0.07852 .
#> importance 0.005134 0.150177 0.034 0.97273
#> information 0.371232 0.130880 2.836 0.00456 **
#> firmness -0.370524 0.172109 -2.153 0.03133 *
#> pros:cons -0.043997 0.045827 -0.960 0.33702
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Log-likelihood: -312.5 on 14 Df
#> LR test for homoscedasticity: 47.75 on 6 Df, p-value: 1.328e-08
#> Dispersion: 1
#> Number of iterations in nlminb optimization: 15
## corresponding model with analytical gradients but numerical Hessian
ab_health2 <- update(ab_health, method = "BFGS", hessian = TRUE)
summary(ab_health2)
#> Warning: NaNs produced
#>
#> Call:
#> hetglm(formula = health ~ ethnicity + gender + religion + religiousness +
#> church + erameans + erasupport | pros * cons + importance + information +
#> firmness, data = AbortionAmbivalence, method = "BFGS", hessian = TRUE)
#>
#> Deviance residuals:
#> Min 1Q Median 3Q Max
#> -3.8071 0.1287 0.2870 0.4568 1.0023
#>
#> Coefficients (binomial model with probit link):
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) 2.54784 NaN NaN NaN
#> ethnicityafam -0.51181 0.25813 -1.983 0.047392 *
#> gendermale -0.07923 0.26810 -0.296 0.767584
#> religioncatholic -0.52051 0.13398 -3.885 0.000102 ***
#> religiousness -0.39103 0.26080 -1.499 0.133783
#> church -1.03816 0.24988 -4.155 3.26e-05 ***
#> erameansyes -0.01783 NaN NaN NaN
#> erasupport 0.32614 NaN NaN NaN
#>
#> Latent scale model coefficients (with log link):
#> Estimate Std. Error z value Pr(>|z|)
#> pros -0.139939 0.024570 -5.696 1.23e-08 ***
#> cons 0.168878 0.025294 6.677 2.45e-11 ***
#> importance 0.005138 0.124854 0.041 0.967
#> information 0.371236 0.075677 4.906 9.32e-07 ***
#> firmness -0.370525 0.166452 -2.226 0.026 *
#> pros:cons -0.043997 0.001685 -26.111 < 2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Log-likelihood: -312.5 on 14 Df
#> LR test for homoscedasticity: 47.75 on 6 Df, p-value: 1.328e-08
#> Dispersion: 1
#> Number of iterations in BFGS optimization: 21
## Alvarez and Brehm (1995), Table 1, p. 1069
## (see also Altman and McDonald, 2003, Supplement, Tables 4-10)
tab1 <- sapply(names(AbortionAmbivalence)[1:7], function(x) {
f <- as.formula(paste(x,
"~ ethnicity + gender + religion + religiousness + church + erameans + erasupport",
"| pros * cons + importance + information + firmness"))
f0 <- as.formula(paste(x, "~ 1"))
m <- hetglm(f, data = AbortionAmbivalence)
m0 <- hetglm(f0, data = model.frame(m))
c(Percent_yes = as.vector(100 * prop.table(table(AbortionAmbivalence[[x]]))["yes"]),
coef(m)[c(1:10, 14, 11:13)],
Heteroscedasticity = as.vector(summary(m)$lrtest[1]),
N = nobs(m),
Goodness_of_fit = 2 * as.vector(logLik(m) - logLik(m0))
)
})
round(tab1, digits = 2)
#> health rape defect poor nomore single any
#> Percent_yes 90.39 83.90 82.14 48.96 45.83 45.52 38.52
#> (Intercept) 2.55 1.92 2.02 0.09 0.03 0.11 -0.07
#> ethnicityafam -0.51 -0.47 -0.54 -0.09 -0.11 -0.23 -0.15
#> gendermale -0.08 -0.21 -0.21 -0.04 -0.02 -0.06 -0.13
#> religioncatholic -0.52 -0.15 -0.33 0.01 0.02 -0.03 0.05
#> religiousness -0.39 -0.17 -0.51 -0.17 -0.13 -0.18 -0.22
#> church -1.04 -0.99 -0.91 -0.35 -0.43 -0.47 -0.79
#> erameansyes -0.02 -0.14 0.01 0.10 0.09 0.09 0.12
#> erasupport 0.33 0.12 0.40 0.22 0.31 0.31 0.51
#> (scale)_pros -0.14 -0.19 -0.06 -0.25 -0.26 -0.34 -0.22
#> (scale)_cons 0.17 0.20 0.37 -0.50 -0.58 -0.41 -0.48
#> (scale)_pros:cons -0.04 -0.03 -0.09 0.19 0.25 0.21 0.22
#> (scale)_importance 0.01 0.17 -0.14 -0.16 -0.18 -0.24 -0.30
#> (scale)_information 0.37 -0.13 0.05 -0.32 -0.28 -0.28 0.68
#> (scale)_firmness -0.37 -0.58 -0.61 0.60 0.47 1.81 0.63
#> Heteroscedasticity 47.75 46.66 41.21 12.55 19.89 27.16 25.87
#> N 1312.00 1302.00 1294.00 1291.00 1289.00 1293.00 1295.00
#> Goodness_of_fit 126.12 173.65 181.27 142.34 182.86 193.55 180.91
if(require("AER")) {
## compare Wald tests with different types of standard errors
coeftest(ab_health)
coeftest(ab_health2)
coeftest(ab_health, vcov = sandwich)
coeftest(ab_health2, vcov = sandwich)
coeftest(ab_health, vcov = vcovOPG)
coeftest(ab_health2, vcov = vcovOPG)
ab_health_tstat <- cbind(
"A-Info" = coeftest(ab_health)[,3],
"N-Info" = coeftest(ab_health2)[,3],
"A-Sandwich" = coeftest(ab_health, vcov = sandwich)[,3],
"N-Sandwich" = coeftest(ab_health2, vcov = sandwich)[,3],
"A-OPG" = coeftest(ab_health, vcov = vcovOPG)[,3],
"N-OPG" = coeftest(ab_health2, vcov = vcovOPG)[,3]
)
round(ab_health_tstat, digits = 3)
}
#> Loading required package: AER
#> Loading required package: car
#> Loading required package: carData
#> Loading required package: lmtest
#> Loading required package: zoo
#>
#> Attaching package: ‘zoo’
#> The following objects are masked from ‘package:base’:
#>
#> as.Date, as.Date.numeric
#> Loading required package: sandwich
#> Loading required package: survival
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> A-Info N-Info A-Sandwich N-Sandwich A-OPG N-OPG
#> (Intercept) 5.089 NaN 0.928 0.494 5.092 5.092
#> ethnicityafam -3.187 -1.983 -1.178 NaN -2.983 -2.983
#> gendermale -0.646 -0.296 -0.524 NaN -0.575 -0.575
#> religioncatholic -3.390 -3.885 -0.583 NaN -3.124 -3.124
#> religiousness -1.784 -1.499 -0.454 -0.630 -1.790 -1.790
#> church -3.649 -4.155 -0.559 NaN -3.513 -3.513
#> erameansyes -0.090 NaN -0.051 -0.012 -0.083 -0.083
#> erasupport 1.612 NaN 0.618 0.268 1.403 1.403
#> (scale)_pros -1.683 -5.696 -0.670 NaN -2.047 -2.047
#> (scale)_cons 1.759 6.677 0.936 1.505 1.740 1.740
#> (scale)_importance 0.034 0.041 0.015 NaN 0.035 0.035
#> (scale)_information 2.836 4.906 1.327 NaN 2.495 2.495
#> (scale)_firmness -2.153 -2.226 -1.902 NaN -1.946 -1.946
#> (scale)_pros:cons -0.960 -26.111 -0.761 NaN -1.047 -1.047