dat
containing the effects listed in effects
. The result is returned as a glm
object.pstar(dat, effects=c("choice", "mutuality", "density", "reciprocity",
"transitivity", "outdegree", "indegree", "betweenness",
"closeness", "degcentralization", "betcentralization",
"clocentralization"), attr=NULL, memb=NULL, diag=FALSE,
mode="digraph")
dat
is directed, else ``graph''glm
objectUsing the effects
argument, a range of different potential parameters can be estimated. The network measure associated with each is, in turn, the edge-perturbed difference in:
gden
and grecip
functions rather than via the unnormalized "choice" and "mutual" quantities one often finds in the p* literature.) Please do not attempt to use all effects simultaneously!!! In addition to the above, the user may specify a matrix of individual attributes whose absolute dyadic differences are to be used as predictors, as well as a matrix of individual memberships whose dyadic categorical similarities (same/different) are used in the same manner.Although the p* framework is quite versatile in its ability to accommodate a range of structural predictors, it should be noted that the substantial collinearity of many of the standard p* predictors can lead to very unstable model fits. Measurement and specification errors compound this problem; thus, it is somewhat risky to use p* in an exploratory capacity (i.e., when there is little prior knowledge to constrain choice of parameters). While raw instability due to multicollinearity should decline with graph size, improper specification will still result in biased coefficient estimates so long as an omitted predictor correlates with an included predictor. Caution is advised.
Holland, P.W., and Leinhardt, S. (1981). ``An Exponential Family of Probability Distributions for Directed Graphs.'' Journal of the American statistical Association, 81, 51-67.
Wasserman, S., and Pattison, P. (1996). ``Logit Models and Logistic Regressions for Social Networks: I. An introduction to Markov Graphs and p*.'' Psychometrika, 60, 401-426.
eval.edgeperturbation
#Create a graph with expansiveness and popularity effects
in.str<-rnorm(20,0,3)
out.str<-rnorm(20,0,3)
tie.str<-outer(out.str,in.str,"+")
tie.p<-apply(tie.str,c(1,2),function(a){1/(1+exp(-a))})
g<-rgraph(20,tprob=tie.p)
#Fit a model with expansiveness only
p1<-pstar(g,effects="outdegree")
#Fit a model with expansiveness and popularity
p2<-pstar(g,effects=c("outdegree","indegree"))
#Fit a model with expansiveness, popularity, and mutuality
p3<-pstar(g,effects=c("outdegree","indegree","mutuality"))
#Compare the model AICs
extractAIC(p1)
extractAIC(p2)
extractAIC(p3)
Run the code above in your browser using DataLab