check_data: Prepares and checks ANC-RT data

Description Usage Arguments Details Value Author(s)

View source: R/check_data.R

Description

Prepares and checks the ANC-RT dataset to ensure that subsequent functions in the ANCRTAdjust package work properly.

Usage

1
2
3
4
check_data(data = NULL, faciluid = NULL, time = NULL,
  n_clients = NULL, n_status = NULL, knownpos = NULL,
  testpos = NULL, testneg = NULL, totpos = NULL, age = NULL,
  snu1 = NULL, year = NULL)

Arguments

data

A country-specific ANC-RT database. The following variables must be included in data:

  • The time period that the data was collected.

  • The unique facility identifier.

  • The number of women from the specified facility, during the specified time period, that attended their first ANC visit.

Optional variables that can be included for re-naming in data include:

  • The number of women from the specified facility, during the specified time period, that had their HIV status ascertained at their first ANC visit, either by testing or through previous knowledge.

  • The number of women from the specified facility, during the specified time period, that tested negative for HIV at their first ANC visit.

  • The number of women from the specified facility, during the specified time period, that tested positive for HIV at their first ANC visit.

  • The number of women from the specified facility, during the specified time period, that already knew that they were HIV-positive at their first ANC visit.

  • Age category of pregnant women.

  • The number of women from the specified facility, during the specified time period, that were HIV-positive at their first ANC visit.

  • The sub-national unit 1.

  • The calendar year from which the data was collected.

faciluid

The variable name in data for the unique facility identifier

time

The variable name in data for the time period that the data was collected

n_clients

The variable name in data for the number of women from the specified facility, during the specified time period, that attended their first ANC visit.

n_status

The variable name in data for the number of women from the specified facility, during the specified time period, that had their HIV status ascertained at their first ANC visit, either by testing or through previous knowledge (if available). If this variable is not specified, it will be created and marked as missing for all observations.

knownpos

The variable name in data for the number of women from the specified facility, during the specified time period, that already knew that they were HIV-positive at their first ANC visit (if available). If this variable is not specified, it will be created and marked as missing for all observations.

testpos

The variable name in data for the number of women from the specified facility, during the specified time period, that tested positive for HIV at their first ANC visit (if available). If this variable is not specified, it will be created and marked as missing for all observations.

testneg

The variable name in data for the number of women from the specified facility, during the specified time period, that tested negative for HIV at their first ANC visit (if available). If this variable is not specified, it will be created and marked as missing for all observations.

totpos

The variable name in data for the number of women from the specified facility, during the specified time period, that were HIV-positive (if available). If this variable name is not specified it will be automatically created by summing testpos and knownpos.

age

The variable name in data for the age category of pregnant women (if available).

snu1

The variable name in data for the sub-national unit 1 (if available).

year

The variable name in data for the sub-national unit 1 (if available).

Details

This function has been developed to prepare the ANC-RT dataset for use within the ANCRTAdjust package. The function ensures that all necessary variables are included in the dataset and renames the variables to ensure that they conform to the naming conventions necessary for use in this package.

Value

The ANC-RT dataset with variables created and/or re-named, if necessary, ensuring that subsequent package functions will work.

Author(s)

Mathieu Maheu-Giroux

Brittany Blouin


brittanyblouin/ANCRTAdjust documentation built on Oct. 28, 2019, 4:53 a.m.