fdrInteraction: Critical t-statistic

Description Usage Arguments Value Author(s) References Examples

Description

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.

Usage

1
fdrInteraction(me.vec, me.sd.vec, df, type = "BH", level = 0.95)

Arguments

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.

Value

The critical t-statistic for the interaction.

Author(s)

Justin Esarey and Jane Lawrence Sumner

References

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.'"

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
## 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)

interactionTest documentation built on June 7, 2019, 1:02 a.m.