Learn R Programming

nonprobsampling (version 0.1.0)

raking_build: Build pseudo-weights using the calibration (raking) method

Description

Build pseudo-weights using the calibration (raking) method

Usage

raking_build(
  vars,
  sc,
  sp,
  sp_des,
  wts.col,
  control,
  verbose = FALSE,
  log_messages = NULL
)

Value

A list with components:

weights

Numeric vector of calibration pseudo-weights for `sc`.

coefficients

Named numeric vector of participation model coefficients.

solver_diagnostics

List of solver convergence diagnostics.

log_messages

Updated character vector of log messages.

internal

List containing design matrices (`Xc`, `Xp`) and sandwich components (`S_beta`, `D`) needed by the estimation stage.

Arguments

vars

Character vector of predictor variable names.

sc

Data frame. The nonprobability sample.

sp

Data frame. The probability reference sample.

sp_des

A `survey.design2` or `svyrep.design` object for `sp`.

wts.col

Character scalar. Name of the survey-weight column in `sp`.

control

A list created by `pw_solver_control()`.

verbose

Logical. If `TRUE`, convergence messages are printed.

log_messages

Character vector of messages accumulated in earlier steps, appended to the returned object unchanged.