From a4bc3db47f07cc95e269d0d0b210122f7cb44ba7 Mon Sep 17 00:00:00 2001 From: Igor Kolodziej Date: Tue, 6 Jan 2026 20:34:39 +0100 Subject: [PATCH 1/2] fix docs --- src_dev/S3/nmar_engine_methods.R | 1 + src_dev/S3/nmar_result_methods.R | 5 +++++ src_dev/S3/nmar_result_print.R | 3 +++ src_dev/engines/el/run_engine.R | 8 ++++++++ src_dev/engines/el/s3.R | 2 ++ src_dev/engines/exptilt-nonparam/impl/exptilt_nonparam.R | 2 ++ src_dev/engines/exptilt/impl/exptilt.R | 2 ++ src_dev/engines/exptilt/s3.R | 2 ++ 8 files changed, 25 insertions(+) diff --git a/src_dev/S3/nmar_engine_methods.R b/src_dev/S3/nmar_engine_methods.R index 8a62d652..af8b965f 100644 --- a/src_dev/S3/nmar_engine_methods.R +++ b/src_dev/S3/nmar_engine_methods.R @@ -101,6 +101,7 @@ s3_engine_display_keys <- function(x) { #' #' @param x An engine object inheriting from `nmar_engine`. #' @param ... Unused. +#' @return `x`, invisibly. #' @keywords engine_view #' @export print.nmar_engine <- function(x, ...) { diff --git a/src_dev/S3/nmar_result_methods.R b/src_dev/S3/nmar_result_methods.R index d9534897..16401771 100644 --- a/src_dev/S3/nmar_result_methods.R +++ b/src_dev/S3/nmar_result_methods.R @@ -30,6 +30,7 @@ NULL #' Variance-covariance for base NMAR results #' @param object An object of class `nmar_result`. #' @param ... Ignored. +#' @return A 1x1 numeric matrix (the variance of the primary estimate). #' @keywords result_param #' @export vcov.nmar_result <- function(object, ...) { @@ -50,6 +51,7 @@ vcov.nmar_result <- function(object, ...) { #' @param parm Ignored. #' @param level Confidence level. #' @param ... Ignored. +#' @return A 1x2 numeric matrix with confidence limits. #' @keywords result_param #' @export confint.nmar_result <- function(object, parm, level = 0.95, ...) { @@ -80,6 +82,8 @@ confint.nmar_result <- function(object, parm, level = 0.95, ...) { #' @param x An object of class `nmar_result`. #' @param conf.level Confidence level for the primary estimate. #' @param ... Ignored. +#' @return A data frame with one row for the primary estimate and, when +#' available, additional rows for the response-model coefficients. #' @keywords result_view #' @method tidy nmar_result #' @export @@ -148,6 +152,7 @@ tidy.nmar_result <- function(x, conf.level = 0.95, ...) { #' @description One-row diagnostics for NMAR fits. #' @param x An object of class `nmar_result`. #' @param ... Ignored. +#' @return A one-row data frame with diagnostics and metadata. #' @keywords result_view #' @method glance nmar_result #' @export diff --git a/src_dev/S3/nmar_result_print.R b/src_dev/S3/nmar_result_print.R index 0f5349bd..0e4dfa95 100644 --- a/src_dev/S3/nmar_result_print.R +++ b/src_dev/S3/nmar_result_print.R @@ -2,6 +2,7 @@ #' #' @param x nmar_result object #' @param ... Additional parameters +#' @return `x`, invisibly. #' @keywords result_view #' @export print.nmar_result <- function(x, ...) { @@ -56,6 +57,7 @@ print.nmar_result <- function(x, ...) { #' @param object nmar_result object #' @param conf.level Confidence level for intervals. #' @param ... Additional parameters +#' @return An object of class `summary_nmar_result`. #' @keywords result_view #' @export @@ -90,6 +92,7 @@ summary.nmar_result <- function(object, conf.level = 0.95, ...) { #' #' @param x summary_nmar_result object #' @param ... Additional parameters +#' @return `x`, invisibly. #' @keywords result_view #' @export diff --git a/src_dev/engines/el/run_engine.R b/src_dev/engines/el/run_engine.R index c6428e07..14fc2cb1 100644 --- a/src_dev/engines/el/run_engine.R +++ b/src_dev/engines/el/run_engine.R @@ -1,4 +1,12 @@ #' Run method for EL engine +#' +#' @param engine An object of class \code{nmar_engine_el}. +#' @param formula A two-sided formula passed through by \code{nmar()}. +#' @param data A \code{data.frame} or \code{survey.design}. +#' @param trace_level Integer 0-3 controlling verbosity. +#' +#' @return An object of class \code{nmar_result_el} (which also inherits from +#' \code{nmar_result}). #' @keywords internal #' @exportS3Method run_engine nmar_engine_el run_engine.nmar_engine_el <- function(engine, formula, data, trace_level = 0) { diff --git a/src_dev/engines/el/s3.R b/src_dev/engines/el/s3.R index b37dd96a..f00609af 100644 --- a/src_dev/engines/el/s3.R +++ b/src_dev/engines/el/s3.R @@ -7,6 +7,7 @@ NULL #' @description Compact print for objects of class \code{nmar_result_el}. #' @param x An object of class \code{nmar_result_el}. #' @param ... Ignored. +#' @return \code{x}, invisibly. #' @keywords result_view #' @export print.nmar_result_el <- function(x, ...) { @@ -45,6 +46,7 @@ print.nmar_result_el <- function(x, ...) { #' @description Summarize estimation, standard error and missingness-model coefficients. #' @param object An object of class \code{nmar_result_el}. #' @param ... Ignored. +#' @return An object of class \code{summary_nmar_result_el}. #' @keywords result_view #' @export summary.nmar_result_el <- function(object, ...) { diff --git a/src_dev/engines/exptilt-nonparam/impl/exptilt_nonparam.R b/src_dev/engines/exptilt-nonparam/impl/exptilt_nonparam.R index da9e7700..ac64c808 100644 --- a/src_dev/engines/exptilt-nonparam/impl/exptilt_nonparam.R +++ b/src_dev/engines/exptilt-nonparam/impl/exptilt_nonparam.R @@ -2,6 +2,8 @@ #' #' @param data A data.frame or survey.design object #' @param ... Other arguments passed to methods +#' @return An engine-specific NMAR result object for the nonparametric +#' exponential tilting estimator. #' @keywords internal exptilt_nonparam <- function(data, ...) { UseMethod("exptilt_nonparam") diff --git a/src_dev/engines/exptilt/impl/exptilt.R b/src_dev/engines/exptilt/impl/exptilt.R index 044a972c..2d8e3ce4 100644 --- a/src_dev/engines/exptilt/impl/exptilt.R +++ b/src_dev/engines/exptilt/impl/exptilt.R @@ -3,6 +3,8 @@ #' Methods are provided for `data.frame` and `survey.design`. #' @param data A `data.frame` or a `survey.design`. #' @param ... Passed to class-specific methods. +#' @return An engine-specific NMAR result object (for example +#' \code{nmar_result_exptilt}). #' @seealso `exptilt.data.frame()`, `exptilt.survey.design()`, `exptilt_engine()` #' @keywords internal exptilt <- function(data, ...) { diff --git a/src_dev/engines/exptilt/s3.R b/src_dev/engines/exptilt/s3.R index 2be48e0f..a8cdb60d 100644 --- a/src_dev/engines/exptilt/s3.R +++ b/src_dev/engines/exptilt/s3.R @@ -13,6 +13,7 @@ NULL #' #' @param x An object of class `nmar_result_exptilt`. #' @param ... Ignored. +#' @return `x`, invisibly. #' @keywords result_view #' @export print.nmar_result_exptilt <- function(x, ...) { @@ -76,6 +77,7 @@ print.nmar_result_exptilt <- function(x, ...) { #' @param object An object of class `nmar_result_exptilt`. #' @param conf.level Confidence level for confidence interval (default 0.95). #' @param ... Ignored. +#' @return An object of class `summary_nmar_result_exptilt`. #' @keywords result_view #' @export summary.nmar_result_exptilt <- function(object, conf.level = 0.95, ...) { From 90190880816bc6ad40fc683e33c6bcb798a84566 Mon Sep 17 00:00:00 2001 From: Igor Kolodziej Date: Tue, 6 Jan 2026 20:58:43 +0100 Subject: [PATCH 2/2] add references --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index b9737fb3..29071345 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,7 +19,8 @@ Authors@R: Description: Methods to estimate finite-population parameters under nonresponse that is not missing at random (NMAR, nonignorable). Incorporates auxiliary information and user-specified response models, and supports independent samples and complex survey designs via objects from the 'survey' package. - Provides diagnostics and optional variance estimates. + Provides diagnostics and optional variance estimates. For methodological background see + Qin, Leung and Shao (2002) and Riddles, Kim and Im (2016) . License: MIT + file LICENSE URL: https://github.com/ncn-foreigners/NMAR, https://ncn-foreigners.ue.poznan.pl/NMAR/index.html BugReports: https://github.com/ncn-foreigners/NMAR/issues