Package 'TwoSampleCalImpute'

Title: Two-Sample Calibrated Imputation for Survey Data
Description: Provides computational implementations of the Two-Sample Calibrated Imputation framework for incomplete survey data when auxiliary information is available from a separate reference sample. The package supports data preparation, survey design specification, calibration, imputation, estimation, variance estimation, diagnostics, reporting, and reproducible analytical workflows.
Authors: Samuel Joel Kamun [aut, cre]
Maintainer: Samuel Joel Kamun <[email protected]>
License: GPL (>= 3)
Version: 0.0.0.9000
Built: 2026-11-09 13:49:31 UTC
Source: https://github.com/kamun2026/twosamplecalimpute

Help Index


Print a tsci_data object

Description

Print a tsci_data object

Usage

## S3 method for class 'tsci_data'
print(x, ...)

Arguments

x

A tsci_data object.

...

Additional arguments.


Print a tsci_design object

Description

Print a tsci_design object

Usage

## S3 method for class 'tsci_design'
print(x, ...)

Arguments

x

A tsci_design object.

...

Additional arguments.


Clean survey data

Description

Performs controlled data-cleaning operations on a tsci_data object without silently changing observed values.

Usage

tsci_clean_data(data, remove_empty_rows = FALSE, remove_empty_columns = FALSE)

Arguments

data

A tsci_data object.

remove_empty_rows

Logical; whether completely empty rows should be removed.

remove_empty_columns

Logical; whether completely empty columns should be removed.

Value

A cleaned tsci_data object.


Export survey data

Description

Exports a tsci_data object to a CSV file.

Usage

tsci_export_data(data, file, row_names = FALSE)

Arguments

data

A tsci_data object.

file

Character path for the output CSV file.

row_names

Logical; whether row names should be written.

Value

Invisibly returns the input tsci_data object.


Import survey data

Description

Imports a data set from a supported file or an existing R object and returns it as a standardized tsci_data object.

Usage

tsci_import_data(
  data,
  sample_type = c("primary", "auxiliary"),
  id = NULL,
  variables = NULL,
  metadata = list()
)

Arguments

data

A data frame, or a character path to a CSV file.

sample_type

Either "primary" or "auxiliary".

id

Optional character identifier variable.

variables

Optional character vector of variables to retain.

metadata

Optional list of metadata.

Value

A tsci_data object.


Validate a survey data set

Description

Performs the basic data-integrity checks required before Two-Sample Calibrated Imputation analysis.

Usage

tsci_validate_data(
  data,
  data_name = "data",
  variables = NULL,
  weights = NULL,
  key = NULL
)

Arguments

data

A data frame to validate.

data_name

A character label used in validation messages.

variables

Optional character vector of variables to validate.

weights

Optional survey weights.

key

Optional character vector identifying records.

Value

A list containing validation results.