covFX | R Documentation |
The function estimates the effect of a shift in monadic covariate values on the probability of edge formation in the network.
covFX(fm, cov, shift, max.val = FALSE)
fm |
An object of class |
cov |
Character string identifying the monadic covariate to be shifted. |
shift |
Numeric value specifying the desired increase or decrease in the monadic covariate. The monadic predictor will be shifted by this value for all nodes and time periods. |
max.val |
An optional numeric value specifying the maximum possible value for the monadic covariate. |
List with named components:
Overall average effect of the covariate shift on the predicted probability of edge formation.
Vector of average effects of the covariate shift on the predicted probability of edge formation for each time period.
Vector of average effects of the covariate shift on the predicted probability of edge formation for each node.
Vector of average effects of the covariate shift on the predicted probability of edge formation for each node dyad.
Vector of estimated effects of the covariate shift on the predicted probability of edge formation for each node dyad-time unit.
Santiago Olivella (olivella@unc.edu), Adeline Lo (aylo@wisc.edu), Tyler Pratt (tyler.pratt@yale.edu), Kosuke Imai (imai@harvard.edu)
library(NetMix)
## Load datasets
data("lazega_dyadic")
data("lazega_monadic")
## Estimate model with 2 groups
lazega_mmsbm <- mmsbm(SocializeWith ~ Coworkers,
~ Age,
senderID = "Lawyer1",
receiverID = "Lawyer2",
nodeID = "Lawyer",
data.dyad = lazega_dyadic,
data.monad = lazega_monadic,
n.blocks = 2,
mmsbm.control = list(seed = 123,
conv_tol = 1e-2,
hessian = FALSE))
## Compute effect of decreasing every lawyers' age by 10 years
fx_list <- covFX(lazega_mmsbm, cov = "Age", shift = -10)
fx_list[["Overall Avg. Effect of Age"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.