Description Usage Arguments Details Value References See Also Examples
View source: R/formatting.covars.R
This function reformats the matrix of input covariates into the required format for the link probabilities and for the mixing proportions.
1 | formatting.covars(covars, link.vars, mix.vars, n)
|
covars |
The n x p data frame of node specific covariates passed in to the overall |
link.vars |
A vector detailing the column numbers of the matrix covars that should be included in the link probabilities model. |
mix.vars |
A vector detailing the column numbers of the matrix covars that should be included in the mixing proportions probabilities model. |
n |
The number of nodes in the network. |
For the link regression model, the difference in the link.vars covariates, for all pairs of nodes is calculated. For the mixing proportions model, the required representation of the mix.vars required is formed, where for categorical/factor variables a dummy value representation is used.
A list with
A matrix with n^2 rows and length(link.vars) columns, detailing the differences in covariates for all pairs of nodes.
A matrix with n rows and number of columns equal to the number of variables detailed in mix.vars, where dummy variable representations will be used for categorical.factor covariates.
Isobel Claire Gormley and Thomas Brendan Murphy. (2010) A Mixture of Experts Latent Position Cluster Model for Social Network Data. Statistical Methodology, 7 (3), pp.385-405.
1 2 3 4 5 6 | data(us.twitter.covariates)
link.vars = c(1)
mix.vars = c(1,5,7,8)
res = formatting.covars(us.twitter.covariates, link.vars, mix.vars, nrow(us.twitter.covariates))
dim(res$x.link)
dim(res$x.mix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.