View source: R/make_strand_data.R
make_strand_data | R Documentation |
This function organizes network data and covariates into a form that can be used by STRAND for model fitting. All STRAND model fitting functions require their data to be supplied in the format exported here.
make_strand_data(
outcome = NULL,
self_report = NULL,
outcome_mode = "bernoulli",
ground_truth = NULL,
block_covariates = NULL,
individual_covariates = NULL,
dyadic_covariates = NULL,
exposure = NULL,
m_e_data = NULL,
mask = NULL,
multiplex = FALSE
)
outcome |
A list of primary network data (e.g., self reports). This argument is just another name for self_report as described below. |
self_report |
A list of primary network data (e.g., self reports). Each entry in the list must be an adjacency matrix. This will be a list of length 1 for single-sampled networks and a list of length 2 for double-sampled networks. Data is presumed to be organized such that self_report[[1]][i,j] represents i's reports of transfers from i to j, and self_report[[2]][i,j] represents i's reports of transfers from j to i. Data should be binary, 0 or 1, unless an alternative outcome_mode is provided. If outcome_mode="poisson", then data can be integer values. If an exposure variable is provided, self_report can take integer values and outcome_mode="binomial" can be set. |
outcome_mode |
Can be either "bernoulli", "binomial", or "poisson", based on the kind of network data being modeled. |
ground_truth |
A list of secondary network data about equivalent latent relationships (i.e., from focal observations). Each entry in the list must be an adjacency matrix. Data is presumed to be organized such that ground_truth[[t]][i,j] represents observed transfers from i to j at time-point t. |
block_covariates |
A vector of group IDs (e.g., ethnicity, class, religion, etc.) corresponding to the individuals in the 'self_report' network(s). This should be provided as a factor. |
individual_covariates |
An N_id by N_parameters dataframe of all individual-level covariates that are to be included in the model. |
dyadic_covariates |
A list of N_id by N_id by N_dyadic_parameters matrices. |
exposure |
A list of matrices matched to the self_report matrices. If self_report is a count data set with binomial outcomes, then this variable holds the sample size information. |
m_e_data |
A list of integer vectors: list(sampled=sampled, sampled_exposure=sampled_exposure, detected=detected, detected_exposure=detected_exposure), to be used in measurement error models. |
mask |
A list of matrices matched to the self_report matrices. If mask[i,j,m]==0, then ties between i and j in layer m are detectable. If mask[i,j,m]==1, then i to j ties in layer m are censored (e.g., if i and j were monkeys kept in different enclosures). |
multiplex |
If TRUE, then all layers in outcome are modeled jointly. |
A list of data formatted for use by STRAND models.
## Not run:
model_dat = make_strand_data(self_report=LoanData)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.