cmreg is used to run a regression with the latent sensitive trait as an outcome.

cmreg(
  formula,
  anchor,
  p,
  p.prime,
  data,
  start = NULL,
  n.start = 3L,
  control = list()
)

Arguments

formula

an object of class "formula": a symbolic description of the model to be fitted. Ex. Crosswise response ~ Covariates. The anchor response is supplied separately through `anchor`.

anchor

Unquoted column name (or a single character column name) for the anchor response.

p

an auxiliary probability for the crosswise question.

p.prime

an auxiliary probability for the anchor question.

data

a data frame containing information from the crosswise model and covariates.

start

Optional numeric vector of starting values for the beta and theta parameters. By default, starts are derived from binomial GLMs for the observed crosswise and anchor responses.

n.start

Number of optimization starts, including the data-informed start.

control

A list of control settings passed to [stats::optim()]. `fnscale` is fixed internally because the log-likelihood is maximized.

Value

An object of class `cmreg`, a list with:

Call

The matched model call.

Coefficients

A coefficient table for the latent-trait outcome model.

AuxiliaryCoef

A coefficient table for the anchor-response model.

VCV

The estimated variance-covariance matrix of all parameters.

estimates, std.errors

Named full-precision parameter estimates and standard errors.

logLik, n, convergence

The optimized log-likelihood, number of complete observations, and optimizer convergence code.

References

Atsusaka, Y. and Stevenson, R. T. (2023). The crosswise model for sensitive survey questions. doi:10.1017/pan.2021.43 .

See also

[cmpredict()] for predicted latent-trait probabilities and [cmreg_p()] for a model with the latent trait as a predictor.

Examples

m <- cmreg(Y ~ female + age, anchor = A, p = 0.1, p.prime = 0.15,
           data = cmdata2)
m
#> Call:
#> cmreg(formula = Y ~ female + age, anchor = A, p = 0.1, p.prime = 0.15, 
#>     data = cmdata2)
#> 
#> Crosswise regression with the latent trait as an outcome.
#> n = 2000, log-likelihood = -2352
#> 
#> Coefficients:
#>             Estimate Std. Error z score Pr(>|z|)
#> (Intercept)  -1.6501     0.4266 -3.8684   0.0001
#> female        0.2813     0.1427  1.9717   0.0486
#> age           0.0326     0.0133  2.4505   0.0143
#> 
#> Auxiliary coefficients:
#>             Estimate Std. Error z score Pr(>|z|)
#> (Intercept)   0.1405     1.1363  0.1237   0.9016
#> female       -0.2059     0.4121 -0.4995   0.6174
#> age           0.0594     0.0394  1.5074   0.1317