timespentsingle.calculator: Calculate time spent being single.

Description Usage Arguments Value Examples

View source: R/Misc/Pre.hhohhoMaxARTFinal.Sim/hho.rsimpacthelper.R View source: R/timespentsingle.calculator.R

Description

Calculates the time spent not being in any relationships, among the subset of women-only who are in the specified age groups during the period of interest. This function allows users to specify different definitions of "being single". Under a "Strict" definition, all time spent not being in a relationship will be calculated per person. Under the definition called "Harling", time is excluded from being single if the person spent part of the year in a relationship. The Harling definition is derived from Harling et al. 2014. This function is called by the incidence.calculator function and used to optionally exclude exposure time in incidence calculations.

Usage

1
2
timespentsingle.calculator(datalist = datalist, agegroup = c(15, 30),
  timewindow = c(20, 30), type = "Strict")

Arguments

datalist

The list object that is produced by readthedata

agegroup

Boundaries of the age group (lower bound <= age < upper bound) that should be retained. Should be expressed as a vector of two integers. e.g. c(15, 30)

timewindow

Boundaries of the time window (lower bound < time <= upper bound) that should be retained. Should be expressed as a vector of two integers. e.g. c(20, 30)

type

If type is "Strict", all time spent being not being in any relationship will be excluded from exposure time. If type is "Harling", time will be excluded from exposure time in blocks of one year, if the person spent that entire block not in any relationship.

Value

A dataframe with a column of women indentifiers (woman.ID) and a column for the time they spent being single (sum.norels.timespent).

Examples

1
2
3
4
5
cfg <- list() 
modeloutput <- RSimpactCyan::simpact.run(configParams = cfg, destDir = "temp") 
dl <- readthedata(modeloutput) 
timespentsingle <- timespentsingle.calculator(datalist = dl, agegroup = c(15, 30), timewindow = c(20, 30), type = "Strict")
timespentsingle

wdelva/RSimpactHelp documentation built on Dec. 26, 2019, 3:42 a.m.