degree.df.maker: Degree distribution of persons in recent sexual...

Description Usage Arguments Value Examples

View source: R/degree.df.maker.R

Description

Creates a dataframe for the degree distribution of persons specified from the dataset produced by agemix.df.maker. This function allows users to specify whether they want new relationships or ongoing relationships among a specified age group, gender, or HIV status of persons in the dataset.

Usage

1
2
3
degree.df.maker(df = rels.episodes.df, agegroup = c(15, 30),
  hivstatus = 0, survey.time = 40, window.width = 1,
  gender.degree = "female", only.new = TRUE)

Arguments

df

The dataframe that is produced by agemix.df.maker

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)

hivstatus

HIV status at the time of the survey. Options are: 0 = only HIV-negative, 1 = only HIV-positive, 2 = all

survey.time

Numeric integer representing the time point of the cross-sectional glance at the data

window.width

Numeric integer representing how long before the cross-sectional glance should you look at the data. E.g 1 year before the survey

gender.degree

The gender or the persons in the data. c("male", "female")

only.new

Logical indicator. If TRUE, only relationships that were newly started during window.width are counted (i.e. the individual was NEVER in a relationship with these partners before the start of the window). If FALSE, all relationships that were ongoing at some point during the window.width are counted.

Value

A dataframe that has the columns "ID" and "Degree"

Examples

1
2
3
4
5
cfg <- list()
modeloutput <- RSimpactCyan::simpact.run(configParams = cfg, destDir = "temp")
dl <- readthedata(modeloutput)
rels.episodes.df <- agemix.df.maker(datalist = dl)
degree.df <- degree.df.maker(df = rels.episodes.df, agegroup = c(20, 30), hivstatus = 1)

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