countEffects: Average and conditional treatment effects for count outcomes

Description Usage Arguments Value Examples

View source: R/countEffects.R

Description

A general function to estimate average and conditional treatment effects for a count outcome.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
countEffects(
  y,
  x,
  k = NULL,
  z = NULL,
  data,
  method = "nb",
  distribution = "condNormal",
  control = "default",
  measurement = list(),
  na.rm = TRUE
)

Arguments

y

Dependent variable (character string). Has to be the name of a count variable (i.e., non-negative integer).

x

Treatment variable (character string) currently treated as binary variable.

k

Categorical covariate (character string).

z

Continuous covariate (character string).

data

A data frame.

method

By default a negative binomial regression model is fitted (i.e., "nb"). Alternatively, with "poisson" a standard Poisson regression is fitted.

distribution

Distribution of the covariate. By default, normal distribution is assumed (i.e., "normal"). Currently, a uniform distribution (i.e., "uniform"), a Poisson distribution (i.e., "poisson"), a chisquare distribution (i.e., "chisquare"), and a negative binomial distribution (i.e., "negbin") are possible.

control

Name or value of the control group

measurement

List containing information for a measurement model (i.e., name of the latent variable and its indicators)

na.rm

Should rows with missing values be removed?

Value

Object of class countEffects.

Examples

1
2
3
4
## Example with normally distributed covariate:
m1 <- countEffects(y="dv", x="treat", z="pre", data=example01,
                   method="poisson", distribution="condNormal")
summary(m1)

chkiefer/countEffects documentation built on Jan. 24, 2021, 5:04 a.m.