estimate.degree.distns | R Documentation |
Break down RDS degree distributions by trait, and return an object which has the degrees for each trait as well as functions to draw degrees from each trait.
estimate.degree.distns(survey.data, d.hat.vals, traits, keep.vars = NULL)
survey.data |
The respondent info |
d.hat.vals |
The variable that contains the degrees for each respondent |
traits |
A vector of the names of the columns
of |
keep.vars |
Additional vars to return along with degrees |
One of the items returned as a result is a function,
draw.degrees.fn
, which takes one argument,
traits
. This is a vector of traits and,
for each entry in this vector, draw.degress.fn
returns a draw from the empirical distribution of
degrees among respondents with that trait. So,
draw.degrees.fn(c("0.0", "0.1", "0.1")
would
return a degree drawn uniformly at random from among
the observed degrees of respondents with trait "0.0"
and then two degrees from respondents with trait "0.1"
An object with
distns
a list with one entry per trait value; each
draw.degrees.fn
a function which gets called with one
keep.vars
the name of the other vars that are kept (if any)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.