Package {persuasio}


Title: Causal Inference on Persuasion Effects
Version: 0.1.0
Description: Provides estimation and inference methods for causal persuasion rates in the potential-outcomes framework of Jun and Lee (2023, Journal of Political Economy) <doi:10.1086/724114>. The package computes bounds and confidence intervals for average and local persuasion rates under data scenarios with binary outcomes, treatments, and instruments, and also when only the outcome and instrument are observed. It also provides functions for calculating bounds from summary statistics.
License: GPL (≥ 3)
URL: https://github.com/persuasio/persuasio-r, https://github.com/persuasio/persuasio-stata
BugReports: https://github.com/persuasio/persuasio-r/issues
Encoding: UTF-8
RoxygenNote: 8.0.0
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
Config/testthat/edition: 3
Imports: stats
VignetteBuilder: knitr
Depends: R (≥ 3.5)
LazyData: true
NeedsCompilation: no
Packaged: 2026-07-28 00:04:08 UTC; sokbaelee
Author: Xinrui Chen [aut], Sung Jae Jun [aut], Sokbae Lee [aut, cre]
Maintainer: Sokbae Lee <sl3841@columbia.edu>
Repository: CRAN
Date/Publication: 2026-08-05 17:30:08 UTC

persuasio package

Description

A package for persuasion rate estimation.

Author(s)

Maintainer: Sokbae Lee sl3841@columbia.edu

Authors:

See Also

Useful links:


GKB

Description

Dataset from Gerber, Karlan, and Bergan (2009). The study examines the effect of media exposure on political behavior via a randomized experiment offering households in Prince William County, VA free ten-week subscriptions to the Washington Post (liberal) or the Washington Times (conservative). The authors administered a baseline survey one month before the November 2005 Virginia gubernatorial election, and a follow-up survey a week after the election, covering individuals' voting behavior, candidate preference, political attitudes, and knowledge of recent news events.

Usage

GKB

Format

A data frame with 701 rows and 4 variables:

voteddem_all

indicator (outcome): equal to 1 if the individual voted for the Democratic candidate

readsome

indicator (treatment): equal to 1 if the individual read a newspaper at least several times per week

post

indicator (instrument): equal to 1 if the individual received a free subscription to the Washington Post

MZwave2

indicator (covariate): equal to 1 if the individual was assigned to the second wave of the experiment

Details

To demonstrate functions in the this package, we use a simplified subset of Washington Post subscribers who responded to the follow-up survey (n = 701). The outcome is voting for the Democratic candidate in the 2005 Virginia gubernatorial election. The experiment ran in two waves a week apart due to capacity constraints, with wave assignment recorded in MZwave2. This data subset is also used in Jun and Lee (2023).

Source

Gerber, A., Karlan, D. and Bergan, D. (2009) Data and Code for: Does the Media Matter? A Field Experiment Measuring the Effect of Newspapers on Voting Behavior and Political Opinions. Ann Arbor, MI: Inter-university Consortium for Political and Social Research, 2019-10-12. doi:10.3886/E113559V1

References

Gerber, A., Karlan, D. and Bergan, D. (2009). Does the Media Matter? A Field Experiment Measuring the Effect of Newspapers on Voting Behavior and Political Opinions. American Economic Journal: Applied Economics, 1(2), 35-52. doi:10.1257/app.1.2.35


Estimate the lower bound of the average persuasion rate

Description

Estimates the lower bound on the average persuasion rate (APR) following Jun and Lee (2023). Requires a binary outcome and a binary instrument. Covariates may optionally be supplied, in which case separate models are fit on the z = 1 and z = 0 subgroups and standard errors are not available. With covariates, there are two model specifications: no_interactionand interaction.

Usage

aprlb(y, z, x = NULL, model = "no_interaction", data)

Arguments

y

character, outcome variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

x

optional character, vector of covariates. Defaults to NULL.

model

model specification: "no_interaction" or "interaction". Defaults to no_interaction.

data

data.frame containing variables

Value

A list with:

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

Examples

# Example 1: No covariates
aprlb(y = "voteddem_all", z = "post", data = GKB)

# Example 2: With covariate
aprlb(y = "voteddem_all", z = "post", x = "MZwave2", data = GKB)

# Example 3: Estimate by the covariate
gkb_groups <- split(GKB, GKB$MZwave2)
lapply(gkb_groups, function(sub_data) {
  aprlb(y = "voteddem_all", z = "post", data = sub_data)
})



Estimate the upper bound of the average persuasion rate

Description

Estimates the upper bound on the average persuasion rate (APR) following Jun and Lee (2023). Requires a binary outcome, a binary treatment, and a binary instrument. Covariates may optionally be supplied, in which case separate models are fit on the z = 1 and z = 0 subgroups and standard errors are not available. With covariates, there are two model specifications: no_interactionand interaction.

Usage

aprub(y, t, z, x = NULL, model = "no_interaction", data)

Arguments

y

character, outcome variable name (binary 0/1)

t

character, treatment variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

x

optional character, vector of covariates. Defaults to NULL.

model

character, model specification: "no_interaction" or "interaction". Defaults to no_interaction.

data

data.frame containing variables

Value

A list with:

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

Examples

# Example 1: No covariates
aprub(y = "voteddem_all", t = "readsome", z = "post", data = GKB)

# Example 2: With covariate
aprub(y = "voteddem_all", t = "readsome", z = "post", x = "MZwave2", data = GKB)

# Example 3: Estimate by the covariate
gkb_groups <- split(GKB, GKB$MZwave2)
lapply(gkb_groups, function(sub_data) {
  aprub(y = "voteddem_all", t = "readsome", z = "post", data = sub_data)
})



Calculate the effect of persuasion when information on Pr(y=1|z) and optimally Pr(t=1|z) for each z=0,1 is available

Description

calc4persuasio calculates the effect of persuasion when information on Pr(y=1|z) and optimally Pr(t=1|z) for each z=0,1 is available. The inputs are y1, y0, e1, and e0, corresponding to estimates of P(y=1 \mid z=1), P(y=1 \mid z=0), P(t=1 \mid z=1), and P(t=1 \mid z=0).

Usage

calc4persuasio(y1, y0, e1 = NULL, e0 = NULL)

Arguments

y1

mean outcome under z = 1

y0

mean outcome under z = 0

e1

(optional) mean treatment under z = 1

e0

(optional) mean treatment under z = 0

Details

The outputs of this command are the lower and upper bounds on the average persuasion rate (APR) as well as the lower and upper bounds on the local persuasion rate (LPR).

Value

An object of class calc4persuasio, a list containing:

apr

numeric vector: lower and upper bound

lpr

numeric vector: lower and upper bound

inputs

input values

case

case identifier

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

Examples

# Compute group means from the GKB dataset first
voteddem_all_0 <- mean(GKB$voteddem_all[GKB$post == 0], na.rm = TRUE)
voteddem_all_1 <- mean(GKB$voteddem_all[GKB$post == 1], na.rm = TRUE)

readsome_0 <- mean(GKB$readsome[GKB$post == 0], na.rm = TRUE)
readsome_1 <- mean(GKB$readsome[GKB$post == 1], na.rm = TRUE)

# Estimate bounds from summary statistics
calc4persuasio(
  y1 = voteddem_all_1,
  y0 = voteddem_all_0,
  e1 = readsome_1,
  e0 = readsome_0
)


Estimate the local persuasion rate

Description

Estimates the local persuasion rate (LPR) for compliers. Requires a binary outcome y, a binary treatment t, and a binary instrument z. Covariates x are optional. When covariates are absent, the function returns standard errors and confidence intervals. With covariates, model = "no_interaction" fits one regression with z and x; model = "interaction" fits separate models by instrument group and does not report analytical standard errors.

Usage

lpr4ytz(y, t, z, x = NULL, model = "no_interaction", data)

Arguments

y

character, outcome variable name (binary 0/1)

t

character, treatment variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

x

optional character, vector of covariates. Defaults to NULL.

model

character, model specification: "no_interaction" or "interaction". Defaults to no_interaction.

data

data.frame containing variables

Value

A list with:

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

Examples

# Example 1: No covariates
lpr4ytz(
  y    = "voteddem_all",
  t    = "readsome",
  z    = "post",
  data = GKB
)

# Example 2: With covariate, no-interaction model
lpr4ytz(
  y     = "voteddem_all",
  t     = "readsome",
  z     = "post",
  x     = "MZwave2",
  data = GKB
)

# Example 3: With covariate, interaction model
lpr4ytz(
  y     = "voteddem_all",
  t     = "readsome",
  z     = "post",
  x     = "MZwave2",
  model = "interaction",
  data  = GKB
)



Unified Interface for Causal Inference on Persuasion Effects

Description

Main wrapper for the persuasio package. Provides a unified entry point to all persuasion effect estimators. The function parses inputs and dispatches to the appropriate estimator based on est. The variables y, t, z, and x can be supplied in any order as explicitly named arguments. For est = "apr", "lpr", and "calc", supplying y (outcome), t (treatment), and z (instrument) is mandatory. For est = "yz", where the treatment is unobserved, only y and z are required, while the treatment argument t is ignored. Optional covariates can be supplied to x for any estimator mode.

Usage

persuasio(
  est = c("apr", "lpr", "yz", "calc"),
  y,
  z,
  t = NULL,
  x = NULL,
  data,
  ...
)

Arguments

est

character. Estimator type:

  • "apr": Average persuasion rate bounds for binary outcome, treatment and instrument

  • "lpr": Local persuasion rate bounds for binary outcome, treatment and instrument

  • "yz": Average and local persuasion rate bounds using binary outcome and instrument only

  • "calc": Average and local persuasion rate calculation from summary statistics

y

character, outcome variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

t

character, treatment variable name (binary 0/1). Required for est = "apr", "lpr", and "calc". Defaults to NULL.

x

optional character, vector of covariates Defaults to NULL.

data

data.frame containing variables

...

additional arguments passed to downstream estimators

Details

This function only performs:

  1. input parsing

  2. method dispatch

Value

An object of class depending on est:

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

See Also

aprlb, aprub, lpr4ytz, calc4persuasio

Examples

# Example 1: Average persuasion rate (APR) with normal inference
persuasio(
  est = "apr",
  y = "voteddem_all",
  t = "readsome",
  z = "post",
  level = 0.80,
  method = "normal",
  data = GKB
)

# Example 2: Local persuasion rate (LPR) with normal inference
persuasio(
  est = "lpr",
  y = "voteddem_all",
  t = "readsome",
  z = "post",
  level = 0.80,
  method = "normal",
  data = GKB
)

# Example 3: Outcome-instrument bounds with covariate and bootstrap inference
persuasio(
  est = "yz",
  y = "voteddem_all",
  z = "post",
  x = "MZwave2",
  level = 0.80,
  model = "interaction",
  method = "bootstrap",
  nboot = 1000,
  data = GKB
)



Causal Inference on the Average Persuasion Rate

Description

Estimates the Average Persuasion Rate (APR) and constructs confidence intervals for binary outcome y, binary treatment t, and binary instrument z. Combines lower and upper bound estimation via aprlb and aprub with inference using either a Stoye (2009)-style asymptotic normal approximation or bootstrap resampling.

When covariates are absent, both inference methods are available. When covariates are present, method = "bootstrap" is recommended as standard errors are not available analytically.

This function combines:

Usage

persuasio4ytz(
  y,
  t,
  z,
  x = NULL,
  model = "no_interaction",
  method = "normal",
  level = 0.95,
  nboot = 50,
  data
)

Arguments

y

character, outcome variable name (binary 0/1)

t

character, treatment variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

x

optional character, vector of covariates. Defaults to NULL.

model

model specification: "no_interaction" or "interaction"

method

inference method: "normal" or "bootstrap"

level

confidence level (default 0.95)

nboot

number of bootstrap replications (default 50)

data

data.frame containing variables

Details

When method = "normal", the function uses a Stoye (2009)-style correction for partially identified parameters. Standard errors from both aprlb and aprub are available only when there are no covariates.

When method = "bootstrap", the function constructs confidence intervals from empirical quantiles of bootstrap replicates of the bound estimates. This is the recommended approach when covariates are present or when the sample size is small.

Value

An object of class persuasio4ytz containing:

lb_coef

lower bound estimate

ub_coef

upper bound estimate

ci_lb

lower confidence bound

ci_ub

upper confidence bound

level

confidence level

method

inference method used

n

sample size

outcome

Y variable name

treatment

T variable name

instrument

Z variable name

covariates

covariates used

model

model specification

nboot

number of bootstrap draws (if applicable)

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

See Also

aprlb, aprub, lpr4ytz, persuasio

Examples

# Example 1: No covariates, normal inference
persuasio4ytz(
  y      = "voteddem_all",
  t      = "readsome",
  z      = "post",
  method = "normal",
  level  = 0.80,
  data   = GKB
)

# Example 2: No covariates, bootstrap inference
persuasio4ytz(
  y      = "voteddem_all",
  t      = "readsome",
  z      = "post",
  method = "bootstrap",
  level  = 0.80,
  nboot  = 100,
  data   = GKB
)

# Example 3: With covariate, interaction model, bootstrap inference
persuasio4ytz(
  y      = "voteddem_all",
  t      = "readsome",
  z      = "post",
  x      = "MZwave2",
  model  = "interaction",
  method = "bootstrap",
  level  = 0.80,
  nboot  = 100,
  data   = GKB
)


Causal Inference on the Local Persuasion Rate

Description

Estimates the Local Persuasion Rate (LPR) and constructs confidence intervals for binary outcome y, binary treatment t, and binary instrument z. Wraps lpr4ytz for point estimation and performs inference using either a standard normal approximation or bootstrap resampling.

The LPR measures the persuasion effect among compliers — those whose treatment status is switched by the instrument. Unlike the APR (see persuasio4ytz), the LPR is a point-identified quantity under the assumptions of Jun and Lee (2023), so a single confidence interval rather than a bound interval is returned.

When covariates are absent and method = "normal", a delta-method standard error from lpr4ytz is used. When covariates are present, bootstrap inference is recommended and is required when analytical standard errors are unavailable, such as under model = "interaction".

Usage

persuasio4ytz2lpr(
  y,
  t,
  z,
  x = NULL,
  model = "no_interaction",
  method = "normal",
  level = 0.95,
  nboot = 50,
  data
)

Arguments

y

character, outcome variable name (binary 0/1)

t

character, treatment variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

x

optional character, vector of covariates. Defaults to NULL.

model

model specification: "no_interaction" or "interaction"

method

inference method: "normal" or "bootstrap"

level

confidence level (default 0.95)

nboot

number of bootstrap replications (default 50)

data

data.frame containing variables

Details

When method = "normal", the confidence interval is constructed as

\hat{\theta}_{LPR} \pm z_{\alpha/2} \cdot \widehat{se}

where \widehat{se} is the delta-method standard error returned by lpr4ytz. This requires se to be non-missing; if se = NA, the normal method is not available and method = "bootstrap" must be used.

When method = "bootstrap", the confidence interval is constructed from empirical quantiles of bootstrap replications of the LPR estimate. For reproducible bootstrap results, call set.seed() before running this function.

Value

An object of class persuasio4ytz2lpr containing:

lpr

local persuasion rate estimate

ci_lb

lower confidence bound

ci_ub

upper confidence bound

se

standard error (NA if bootstrap)

level

confidence level

method

inference method used

n

sample size

outcome

Y variable name

treatment

T variable name

instrument

Z variable name

covariates

covariates used

model

model specification

nboot

number of bootstrap replications (if applicable)

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

See Also

lpr4ytz, persuasio4ytz, persuasio

Examples

# Example 1: No covariates, normal inference
persuasio4ytz2lpr(
  y      = "voteddem_all",
  t      = "readsome",
  z      = "post",
  method = "normal",
  level  = 0.80,
  data   = GKB
)

# Example 2: No covariates, bootstrap inference
persuasio4ytz2lpr(
  y      = "voteddem_all",
  t      = "readsome",
  z      = "post",
  method = "bootstrap",
  level  = 0.80,
  nboot  = 100,
  data   = GKB
)

# Example 3: With covariate, interaction model, bootstrap inference
persuasio4ytz2lpr(
  y      = "voteddem_all",
  t      = "readsome",
  z      = "post",
  x      = "MZwave2",
  model  = "interaction",
  method = "bootstrap",
  level  = 0.80,
  nboot  = 100,
  data   = GKB
)


Causal Inference on Persuasion Effects Using Outcome and Instrument Only

Description

Estimates bounds on the Average Persuasion Rate (APR) using only a binary outcome y and a binary instrument z. Combines lower and upper bound estimation via aprlb and aprub under the YZ formulation with inference using either a Stoye (2009)-style normal approximation or bootstrap resampling.

This function is appropriate when treatment variables are unavailable or when the researcher wishes to bound the APR using only the reduced-form relationship between the instrument and the outcome. When treatment data are available, use persuasio4ytz instead.

When covariates are absent, both inference methods are available. When covariates are present, analytic standard errors are unavailable and method = "bootstrap" is required.

Usage

persuasio4yz(
  y,
  z,
  x = NULL,
  model = "no_interaction",
  method = "normal",
  level = 0.95,
  nboot = 50,
  data
)

Arguments

y

character, outcome variable name (binary 0/1)

z

character, instrument variable name (binary 0/1)

x

optional character, vector of covariates. Defaults to NULL.

model

model specification: "no_interaction" or "interaction"

method

inference method: "normal" or "bootstrap"

level

confidence level (default 0.95)

nboot

number of bootstrap replications (default 50)

data

data.frame containing variables

Details

When method = "normal", the function applies a Stoye (2009)-style correction using the analytical standard error for the lower-bound estimator returned by aprlb. The upper bound is fixed at 1. If the lower bound standard error is unavailable, use method = "bootstrap" instead.

When method = "bootstrap", the function constructs the confidence interval from empirical quantiles of jointly resampled lower and upper bound estimates. For reproducible bootstrap results, call set.seed() before running this function.

Value

An object of class persuasio4yz containing:

lb_coef

lower bound estimate

ub_coef

upper bound estimate

ci_lb

lower confidence bound

ci_ub

upper confidence bound

level

confidence level

method

inference method used

n

sample size

outcome

Y variable name

instrument

Z variable name

covariates

covariates used

model

model specification

nboot

number of bootstrap replications (if applicable)

References

Sung Jae Jun and Sokbae Lee (2023). Identifying the Effect of Persuasion. Journal of Political Economy, 131(8). https://doi.org/10.1086/724114

See Also

aprlb, aprub, persuasio4ytz, persuasio

Examples

# Example 1: No covariates, normal inference
persuasio4yz(
  y      = "voteddem_all",
  z      = "post",
  method = "normal",
  level  = 0.80,
  data   = GKB
)

# Example 2: No covariates, bootstrap inference
persuasio4yz(
  y      = "voteddem_all",
  z      = "post",
  method = "bootstrap",
  level  = 0.80,
  nboot  = 1000,
  data   = GKB
)

# Example 3: With covariate, interaction model, bootstrap inference
persuasio4yz(
  y      = "voteddem_all",
  z      = "post",
  x      = "MZwave2",
  model  = "interaction",
  method = "bootstrap",
  level  = 0.80,
  nboot  = 1000,
  data   = GKB
)


Print method for aprlb objects

Description

Print method for aprlb objects

Usage

## S3 method for class 'aprlb'
print(x, digits = 4, ...)

Arguments

x

object of class "aprlb"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of the lower bound estimate on the average persuasion rate, including the estimate, standard error, and confidence interval.


Print method for aprub objects

Description

Print method for aprub objects

Usage

## S3 method for class 'aprub'
print(x, digits = 4, ...)

Arguments

x

object of class "aprub"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of the upper bound estimate on the average persuasion rate, including the estimate, standard error, and confidence interval.


Print method for calc4persuasio

Description

Print method for calc4persuasio

Usage

## S3 method for class 'calc4persuasio'
print(x, digits = 4, ...)

Arguments

x

object of class "calc4persuasio"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of APR and LPR bounds computed from summary statistics, together with the input probabilities.


Print method for lpr4ytz objects

Description

Print method for lpr4ytz objects

Usage

## S3 method for class 'lpr4ytz'
print(x, digits = 4, ...)

Arguments

x

object of class "lpr4ytz"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of the local persuasion rate estimate, standard error, and confidence interval.


Print method for persuasio4ytz

Description

Print method for persuasio4ytz

Usage

## S3 method for class 'persuasio4ytz'
print(x, digits = 4, ...)

Arguments

x

object of class "persuasio4ytz"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of the average persuasion rate estimate.


Print method for persuasio4ytz2lpr

Description

Print method for persuasio4ytz2lpr

Usage

## S3 method for class 'persuasio4ytz2lpr'
print(x, digits = 4, ...)

Arguments

x

object of class "persuasio4ytz2lpr"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of the local persuasion rate estimate.


Print method for persuasio4yz

Description

Print method for persuasio4yz

Usage

## S3 method for class 'persuasio4yz'
print(x, digits = 4, ...)

Arguments

x

object of class "persuasio4yz"

digits

number of decimal places to display (default is 4)

...

unused

Value

Invisibly returns x. Called for its side effect of printing a formatted summary of the average persuasion rate estimate.

mirror server hosted at Truenetwork, Russian Federation.