Title: | Calculates Critical Test Statistics to Control False Discovery Rates in Marginal Effects Plots |
---|---|
Description: | Implements the procedures suggested in Esarey and Sumner (2017) <http://justinesarey.com/interaction-overconfidence.pdf> for controlling the false discovery rate when constructing marginal effects plots for models with interaction terms. |
Authors: | Justin Esarey and Jane Lawrence Sumner |
Maintainer: | Justin Esarey <[email protected]> |
License: | GPL |
Version: | 1.2 |
Built: | 2024-12-19 06:36:27 UTC |
Source: | CRAN |
This function is defunct.
bootFun(...)
bootFun(...)
... |
Any argument to the function (ignored). |
Esarey, Justin, and Jane Lawrence Sumner. 2018. "Corrigendum to 'Marginal Effects in Interaction Models: Determining and Controlling the False Positive Rate.'"
This function calculates the critical t-statistic to limit the false discovery rate (Benjamini and Hochberg 1995) for a marginal effects plot to a specified level.
fdrInteraction(me.vec, me.sd.vec, df, type = "BH", level = 0.95)
fdrInteraction(me.vec, me.sd.vec, df, type = "BH", level = 0.95)
me.vec |
A vector of marginal effects. |
me.sd.vec |
A vector of standard deviations for the marginal effects. |
df |
Degrees of freedom. |
type |
Should the BH (Benjamini and Hochberg 1999) or BY (Benjamini and Yekutieli 2000) correction be used? Options are "BH" (the default) or "BY". |
level |
The level of confidence. Defaults to 0.95. |
The critical t-statistic for the interaction.
Justin Esarey and Jane Lawrence Sumner
Benjamini, Yoav, and Yosef Hochberg. 1995. "Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing." Journal of the Royal Statistical Society, Series B 57(1): 289-300.
Benjamini, Yoav, and Daniel Yekutieli. 2001. "The Control of the False Discovery Rate in Multiple Testing Under Dependency." The Annals of Statistics 29(4): 1165-1188.
Clark, William R., and Matt Golder. 2006. "Rehabilitating Duverger's Theory." Comparative Political Studies 39(6): 679-708.
Esarey, Justin, and Jane Lawrence Sumner. 2017. "Marginal Effects in Interaction Models: Determining and Controlling the False Positive Rate." Comparative Political Studies 51(9): 1144-1176.
Esarey, Justin, and Jane Lawrence Sumner. 2018. "Corrigendum to 'Marginal Effects in Interaction Models: Determining and Controlling the False Positive Rate.'"
## Not run: data(legfig) # Clark and Golder 2006 replication data # limit to established democracies from the 1990s dat<-subset(legfig, subset=(nineties==1 & old==1)) lin.mod <- lm(enep1 ~ eneg + logmag + logmag_eneg + uppertier_eneg + uppertier + proximity1 + proximity1_enpres + enpres, data=dat) # save betas beta.mod <- coefficients(lin.mod) # save vcv vcv.mod <- vcov(lin.mod) # calculate MEs mag <- seq(from=0.01, to=5, by=0.01) me.vec <- beta.mod[2] + beta.mod[4]*mag me.se <- sqrt( vcv.mod[2,2] + (mag^2)*vcv.mod[4,4] + 2*(mag)*(vcv.mod[2,4]) ) ci.hi <- me.vec + 1.697 * me.se ci.lo <- me.vec - 1.697 * me.se plot(me.vec ~ mag, type="l", ylim = c(-4, 6)) lines(ci.hi ~ mag, lty=2) lines(ci.lo ~ mag, lty=2) fdrInteraction(me.vec, me.se, df=lin.mod$df, level=0.90) # 4.233986 ci.hi <- me.vec + 4.233986 * me.se ci.lo <- me.vec - 4.233986 * me.se lines(ci.hi ~ mag, lty=2, lwd=2) lines(ci.lo ~ mag, lty=2, lwd=2) abline(h=0, lty=1, col="gray") legend("topleft", lwd=c(1,2), lty=c(1,2), legend=c("90% CI", "90% FDR CI")) ## End(Not run)
## Not run: data(legfig) # Clark and Golder 2006 replication data # limit to established democracies from the 1990s dat<-subset(legfig, subset=(nineties==1 & old==1)) lin.mod <- lm(enep1 ~ eneg + logmag + logmag_eneg + uppertier_eneg + uppertier + proximity1 + proximity1_enpres + enpres, data=dat) # save betas beta.mod <- coefficients(lin.mod) # save vcv vcv.mod <- vcov(lin.mod) # calculate MEs mag <- seq(from=0.01, to=5, by=0.01) me.vec <- beta.mod[2] + beta.mod[4]*mag me.se <- sqrt( vcv.mod[2,2] + (mag^2)*vcv.mod[4,4] + 2*(mag)*(vcv.mod[2,4]) ) ci.hi <- me.vec + 1.697 * me.se ci.lo <- me.vec - 1.697 * me.se plot(me.vec ~ mag, type="l", ylim = c(-4, 6)) lines(ci.hi ~ mag, lty=2) lines(ci.lo ~ mag, lty=2) fdrInteraction(me.vec, me.se, df=lin.mod$df, level=0.90) # 4.233986 ci.hi <- me.vec + 4.233986 * me.se ci.lo <- me.vec - 4.233986 * me.se lines(ci.hi ~ mag, lty=2, lwd=2) lines(ci.lo ~ mag, lty=2, lwd=2) abline(h=0, lty=1, col="gray") legend("topleft", lwd=c(1,2), lty=c(1,2), legend=c("90% CI", "90% FDR CI")) ## End(Not run)
This function is defunct.
findMultiLims(...)
findMultiLims(...)
... |
Any argument to the function (ignored). |
Esarey, Justin, and Jane Lawrence Sumner. 2018. "Corrigendum to 'Marginal Effects in Interaction Models: Determining and Controlling the False Positive Rate.'"
District magnitude and ethnic heterogeneity data from a pooled sample of established democracies in the 1990s. Data originally from Clark and Golder (2006).
A data frame with 754 rows and 33 variables:
country name
country number
year of observation
electoral parties
ethnic heterogeneity
district magnitude
legislative election
presidential election
regime as of 31 Dec of given year (0=democracy, 1=dictatorship)
regime type at time of leg. election (0=democracy, 1=dictatorship)
election in 1980s closest to 1985
election in 1990s closest to 1995
elections in countries that did not transition to democracy in 1990s
average district magnitude
number of electoral districts
effective number of ethnic groups fearon
n/a
parliamentary parties - uncorrected
n/a
parliamentary parties - corrected
effective number of presidential candidates
median district magnitude
first election of new democracy
proximity - continuous
proximity - dichotomous
assembly size
number of upper tier seats
percentage of uppertier seats
uppertier*eneg
logmag*eneg
proximity1*enpres
n/a
n/a
...
Clark, William R., and Matt Golder. 2006. "Rehabilitating Duverger's Theory." Comparative Political Studies 39(6): 679-708.