diff --git a/dev/articles/squeacr.html b/dev/articles/squeacr.html index d39fa42..53a5dae 100644 --- a/dev/articles/squeacr.html +++ b/dev/articles/squeacr.html @@ -526,10 +526,10 @@

Calculating CMAM program group_by(State, Year) |> summarise( total_discharge = sum(`Total Discharge`, na.rm = TRUE), - cure_rate = calculate_cured(sum(Cured, na.rm = TRUE), total_discharge), - default_rate = calculate_default(sum(Default, na.rm = TRUE), total_discharge), - death_rate = calculate_dead(sum(Death, na.rm = TRUE), total_discharge), - non_response_rate = calculate_no_response(sum(`Non-Responder`, na.rm = TRUE), total_discharge), + cure_rate = calculate_cured(sum(Cured, na.rm = TRUE), total_discharge), + default_rate = calculate_default(sum(Default, na.rm = TRUE), total_discharge), + death_rate = calculate_dead(sum(Death, na.rm = TRUE), total_discharge), + non_response_rate = calculate_no_response(sum(`Non-Responder`, na.rm = TRUE), total_discharge), .groups = "drop" )

which results in the following:

@@ -594,7 +594,7 @@

CMAM programme length-of-stay
-calculate_median_los(otp_beneficiaries$admDate, otp_beneficiaries$disDate)
+calculate_los_median(otp_beneficiaries$admDate, otp_beneficiaries$disDate)

which gives the following results:

#> Warning in calculate_los(admission_date = admission_date, discharge_date =
 #> discharge_date): Some admission date/s are not in YYYY-MM-DD format or are not
@@ -621,9 +621,9 @@ 

CMAM programme coverageroutr_{out} can be calculated as follows:

-calculate_rout(cin = 5, cout = 25, rin = 5)
+calculate_rout(cin = 5, cout = 25, rin = 5)
 #> [1] 6
-

Note here that the calculate_rout() function has another +

Note here that the calculate_rout() function has another argument named k which is a correction factor representing the ratio of the mean length of an untreated episode to the mean length of a CMAM treatment episode. This, by default, is set to @@ -632,10 +632,10 @@

CMAM programme coverage

This calculation for routr_{out} -is used within calculate_tc() to estimate treatment +is used within calculate_tc() to estimate treatment coverage:

-calculate_tc(cin = 5, cout = 25, rin = 5)
+calculate_tc(cin = 5, cout = 25, rin = 5)
 #> [1] 0.2439024
diff --git a/dev/index.html b/dev/index.html index 35920a1..7123e75 100644 --- a/dev/index.html +++ b/dev/index.html @@ -488,10 +488,10 @@

Calculating CMAM program group_by(State, Year) |> summarise( total_discharge = sum(`Total Discharge`, na.rm = TRUE), - cure_rate = calculate_cured(sum(Cured, na.rm = TRUE), total_discharge), - default_rate = calculate_default(sum(Default, na.rm = TRUE), total_discharge), - death_rate = calculate_dead(sum(Death, na.rm = TRUE), total_discharge), - non_response_rate = calculate_no_response(sum(`Non-Responder`, na.rm = TRUE), total_discharge), + cure_rate = calculate_cured(sum(Cured, na.rm = TRUE), total_discharge), + default_rate = calculate_default(sum(Default, na.rm = TRUE), total_discharge), + death_rate = calculate_dead(sum(Death, na.rm = TRUE), total_discharge), + non_response_rate = calculate_no_response(sum(`Non-Responder`, na.rm = TRUE), total_discharge), .groups = "drop" )

which results in the following:

@@ -553,7 +553,7 @@

CMAM programme length-of-stay#> [401] 84 28 28 66 56

The median length-of-stay in a CMAM programme can be calculated as follows:

-calculate_median_los(otp_beneficiaries$admDate, otp_beneficiaries$disDate)
+calculate_los_median(otp_beneficiaries$admDate, otp_beneficiaries$disDate)

which gives the following results:

#> Warning in calculate_los(admission_date = admission_date,
 #> discharge_date = discharge_date): Some admission date/s are not in
@@ -569,12 +569,12 @@ 

CMAM programme coverageThe squeacr provides functions to calculate programme coverage. These functions implement the single coverage estimator approach[1]. In this approach, treatment coverage is calculated in such a way that estimates r_out or the number of severe acute malnutrition (SAM) cases that have not been enrolled in the programme but have been recovering without treatment.

For example, if a coverage survey yielded 5 SAM cases in the programme, 25 cases not in the programme, and 5 recovering cases in the programme, r_out can be calculated as follows:

-calculate_rout(cin = 5, cout = 25, rin = 5)
+calculate_rout(cin = 5, cout = 25, rin = 5)
 #> [1] 6
-

Note here that the calculate_rout() function has another argument named k which is a correction factor representing the ratio of the mean length of an untreated episode to the mean length of a CMAM treatment episode. This, by default, is set to k = 3 in the function. However, this should be adjusted based on programme data to estimate the mean length of a SAM treatment episode.

-

This calculation for r_out is used within calculate_tc() to estimate treatment coverage:

+

Note here that the calculate_rout() function has another argument named k which is a correction factor representing the ratio of the mean length of an untreated episode to the mean length of a CMAM treatment episode. This, by default, is set to k = 3 in the function. However, this should be adjusted based on programme data to estimate the mean length of a SAM treatment episode.

+

This calculation for r_out is used within calculate_tc() to estimate treatment coverage:

-calculate_tc(cin = 5, cout = 25, rin = 5)
+calculate_tc(cin = 5, cout = 25, rin = 5)
 #> [1] 0.2439024

diff --git a/dev/news/index.html b/dev/news/index.html index 78ca197..c5885a6 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -37,14 +37,20 @@

squeacr 0.1.0.9000 (development version)

This is a GitHub-only development version of the squeacr package.

+

New features

+
+

General updates

  • added vignettes;

  • updated README;

  • -
  • re-factored calculate_performance() functions;

  • +
  • updated documentation of coverage estimators;

  • +
  • updated documentation of performance calculators;

Bug fixes

-


+


diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 50dfa8c..aa59474 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: squeacr: squeacr.html -last_built: 2024-12-14T16:18Z +last_built: 2024-12-14T22:11Z urls: reference: https://nutriverse.io/squeacr/reference article: https://nutriverse.io/squeacr/articles diff --git a/dev/reference/calculate_cf.html b/dev/reference/calculate_cf.html index 5473861..9f66e9e 100644 --- a/dev/reference/calculate_cf.html +++ b/dev/reference/calculate_cf.html @@ -1,101 +1,8 @@ - -Estimate case finding effectiveness — calculate_cf • squeacr - Skip to contents - - -
-
-
- -
-

Estimate case finding effectiveness

-
- -
-

Usage

-
calculate_cf(cin, cout)
-
- -
-

Arguments

- - -
cin
-

Cases in CMAM programme

- - -
cout
-

Cases not in CMAM programme

- -
-
-

Value

-

Value of case finding effectiveness

-
-
-

References

-

Safari Balegamire, Katja Siling, Jose Luis Alvarez Moran, -Ernest Guevarra, Sophie Woodhead, Alison Norris, Lionella Fieschi, -Paul Binns, and Mark Myatt (2015). A single coverage estimator for use in -SQUEAC, SLEAC, and other CMAM coverage assessments. Field Exchange 49, -March 2015. p81. <www.ennonline.net/fex/49/singlecoverage>

-
-
-

Author

-

Ernest Guevarra based on technical notes and equations by Mark Myatt

-
- -
-

Examples

-
calculate_cf(cin = 5, cout = 20)
-#> [1] 0.2
-
-
-
-
- - -
- - - -
- - - - - - + + + + + + + diff --git a/dev/reference/calculate_coverage.html b/dev/reference/calculate_coverage.html new file mode 100644 index 0000000..4e42fa1 --- /dev/null +++ b/dev/reference/calculate_coverage.html @@ -0,0 +1,118 @@ + +CMAM coverage estimators — calculate_rout • squeacr + Skip to contents + + +
+
+
+ +
+

CMAM coverage estimators

+
+ +
+

Usage

+
calculate_rout(cin, cout, rin, k = 3)
+
+calculate_cf(cin, cout)
+
+calculate_tc(cin, cout, rin, k = 3)
+
+ +
+

Arguments

+ + +
cin
+

Cases in CMAM programme

+ + +
cout
+

Cases not in CMAM programme

+ + +
rin
+

Recovering cases in programme

+ + +
k
+

Correction factor. Ratio of the mean length of an untreated episode +to the mean length of a CMAM treatment episode

+ +
+
+

Value

+

Numeric value of required coverage estiamtor

+
+
+

References

+

Safari Balegamire, Katja Siling, Jose Luis Alvarez Moran, +Ernest Guevarra, Sophie Woodhead, Alison Norris, Lionella Fieschi, +Paul Binns, and Mark Myatt (2015). A single coverage estimator for use in +SQUEAC, SLEAC, and other CMAM coverage assessments. Field Exchange 49, +March 2015. p81. <www.ennonline.net/fex/49/singlecoverage>

+
+
+

Author

+

Ernest Guevarra based on technical notes and equations by Mark Myatt

+
+ +
+

Examples

+
calculate_rout(cin = 5, cout = 25, rin = 5, k = 3)
+#> [1] 6
+calculate_cf(cin = 5, cout = 20)
+#> [1] 0.2
+calculate_tc(cin = 5, cout = 20, rin = 5, k = 3)
+#> [1] 0.2857143
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/dev/reference/calculate_cured.html b/dev/reference/calculate_cured.html index 7b16714..e7aeeb8 100644 --- a/dev/reference/calculate_cured.html +++ b/dev/reference/calculate_cured.html @@ -1,93 +1,8 @@ - -Calculate CMAM performance indicators - cure rate — calculate_cured • squeacr - Skip to contents - - -
-
-
- -
-

Calculate CMAM performance indicators - cure rate

-
- -
-

Usage

-
calculate_cured(cured, exit)
-
- -
-

Arguments

- - -
cured
-

Numeric value for total number of cured cases

- - -
exit
-

Numeric value for total number of programme exits

- -
-
-

Value

-

A proportion of cured cases of the total programme exits

-
-
-

Author

-

Ernest Guevarra

-
- -
-

Examples

-
calculate_cured(cured = 10, exit = 50)
-#> [1] 0.2
-
-
-
-
- - -
- - - -
- - - - - - + + + + + + + diff --git a/dev/reference/calculate_dead.html b/dev/reference/calculate_dead.html index 99fb643..e7aeeb8 100644 --- a/dev/reference/calculate_dead.html +++ b/dev/reference/calculate_dead.html @@ -1,93 +1,8 @@ - -Calculate CMAM performance indicators - death rate — calculate_dead • squeacr - Skip to contents - - -
-
-
- -
-

Calculate CMAM performance indicators - death rate

-
- -
-

Usage

-
calculate_dead(dead, exit)
-
- -
-

Arguments

- - -
dead
-

Numeric value for total number of cases who died

- - -
exit
-

Numeric value for total number of programme exits

- -
-
-

Value

-

A proportion of dead cases of the total programme exits

-
-
-

Author

-

Ernest Guevarra

-
- -
-

Examples

-
calculate_dead(dead = 10, exit = 50)
-#> [1] 0.2
-
-
-
-
- - -
- - - -
- - - - - - + + + + + + + diff --git a/dev/reference/calculate_default.html b/dev/reference/calculate_default.html index a194c86..e7aeeb8 100644 --- a/dev/reference/calculate_default.html +++ b/dev/reference/calculate_default.html @@ -1,93 +1,8 @@ - -Calculate CMAM performance indicators - default rate — calculate_default • squeacr - Skip to contents - - -
-
-
- -
-

Calculate CMAM performance indicators - default rate

-
- -
-

Usage

-
calculate_default(defaulter, exit)
-
- -
-

Arguments

- - -
defaulter
-

Numeric value for total number of cases who defaulted

- - -
exit
-

Numeric value for total number of programme exits

- -
-
-

Value

-

A proportion of defaulter cases of the total programme exits

-
-
-

Author

-

Ernest Guevarra

-
- -
-

Examples

-
calculate_default(defaulter = 10, exit = 50)
-#> [1] 0.2
-
-
-
-
- - -
- - - -
- - - - - - + + + + + + + diff --git a/dev/reference/calculate_los.html b/dev/reference/calculate_los.html index cafd161..490f65f 100644 --- a/dev/reference/calculate_los.html +++ b/dev/reference/calculate_los.html @@ -1,5 +1,7 @@ -Calculate CMAM length of stay — calculate_los • squeacr +Calculate CMAM length of stay and median length of stay for a cohort of CMAM discharges — calculate_los • squeacr Skip to contents @@ -29,18 +31,21 @@
-

Calculate CMAM length of stay

+

Calculate CMAM length of stay and median length of stay for a cohort of CMAM +discharges

Usage

-
calculate_los(admission_date, discharge_date)
+
calculate_los(admission_date, discharge_date)
+
+calculate_los_median(admission_date, discharge_date, group = NULL)
@@ -57,10 +62,20 @@

Argumentsgroup +

A character value/s with the same length as admission_date and +discharge_data to use as grouping variable within which median +length-of-stay is to be calculated. Default is NULL for no grouping.

+

Value

-

Numeric value or vector of numeric values for length-of-stay in days.

+

Numeric value or vector of numeric values for length-of-stay in days +for calculate_los(). A numeric value for median length-of-stay in +days for calculate_los_median(). If group is not NULL, a vector of +numeric values for median length-of-stay in days with length equal to the +number of groups.

Author

@@ -77,6 +92,27 @@

Examples discharge_date = c("2010-06-14", "2010-06-20")) #> [1] 91 96 +calculate_los_median( + otp_beneficiaries$admDate, + otp_beneficiaries$disDate, + group = otp_beneficiaries$locality +) +#> Warning: Some admission date/s are not in YYYY-MM-DD format or are not available. Returning NA. +#> Warning: Some discharge dates are earlier than admisison dates. Returning NA. +#> group los +#> 1 Alkamlin 52.0 +#> 2 Atbara 50.0 +#> 3 El Fasher 63.0 +#> 4 Halfa 21.0 +#> 5 Kalamendo 35.0 +#> 6 Kassala 63.0 +#> 7 Kutum 58.0 +#> 8 Medani Alkupra 36.0 +#> 9 Sharg Algazira 28.0 +#> 10 South Gazira 26.0 +#> 11 Tawila 28.5 +#> 12 Telkuk 42.0 +