Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

impute.degree

Imputes missing degree values


Description

Imputes missing degree values

Usage

impute.degree(
  rds.data,
  trait.variable = NULL,
  N = NULL,
  method = c("mean", "quantile"),
  quantile = 0.5,
  recruitment.lower.bound = TRUE,
  round.degree = TRUE
)

Arguments

rds.data

an rds.data.frame

trait.variable

the name of the variable in rds.data to stratify the imputation by

N

population size

method

If mean, the weighted mean value is imputed, otherwize a quantile is used.

quantile

If method is "quantile", this is the quantile that is used. Defaults to median

recruitment.lower.bound

If TRUE, then for each individual, the degree is taken to be the minimum of the number of recruits plus one, and the reported degree

round.degree

Should degrees be integer rounded.

Details

This function imputes degree values using the weighted mean or quantile values of the non-missing degrees. Weights are calcualted using Gile's SS if N is not NULL, or RDS-II if it is. If a trait variable is specified, means and quantile are calculated within the levels of the trait variable

Examples

data(faux)
rds.data <- faux
rds.data$network.size[c(1,2,30,52,81,101,108,111)] <- NA
impute.degree(rds.data)
impute.degree(rds.data,trait.variable="X")
impute.degree(rds.data,trait.variable="X",method="quantile")

RDS

Respondent-Driven Sampling

v0.9-3
LGPL-2.1
Authors
Mark S. Handcock [aut, cre], Krista J. Gile [aut], Ian E. Fellows [aut], W. Whipple Neely [aut]
Initial release
2021-03-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.