bbnam
for details.)
bbnam.bf(dat, nprior=0.5, em.fp=0.5, ep.fp=0.5, emprior.pooled=c(1, 11), epprior.pooled=c(1, 11), emprior.actor=c(1, 11), epprior.actor=c(1, 11), diag=FALSE, mode="digraph", reps=1000)
dat[i,j,k]==1
implies that i observed j sending the relation in question to k.) Note that only dichotomous data is supported at present, and missing values are permitted; the data collection pattern, however, is assumed to be ignorable, and hence the posterior draws are implicitly conditional on the observation pattern.nprior[i,j]
gives the prior probability of i
sending the relation to j
in the criterion graph.) Non-matrix values will be coerced/expanded to matrix form as appropriate. If no network prior is provided, an uninformative prior on the space of networks will be assumed (i.e., $Pr(i->j)=0.5$). Missing values are not allowed. "digraph"
indicates that edges should be interpreted as directed; "graph"
indicates that edges are undirected. Mode is set to "digraph"
by default. bayes.factor
.
bbnam
function help) is a fairly simple model for integrating informant reports regarding social network data. bbnam.bf
computes log Bayes Factors (integrated likelihood ratios) for the three error submodels of the bbnam: fixed error probabilities, pooled error probabilities, and per observer/actor error probabilities.
By default, bbnam.bf
uses weakly informative Beta(1,11) priors for false positive and false negative rates, which may not be appropriate for all cases. (Likewise, the initial network prior is uniformative.) Users are advised to consider adjusting the error rate priors when using this function in a practical context; for instance, it is often reasonable to expect higher false negative rates (on average) than false positive rates, and to expect the criterion graph density to be substantially less than 0.5. See the reference below for a discussion of this issue.
Robert, C. (1994). The Bayesian Choice: A Decision-Theoretic Motivation. Springer.
bbnam
#Create some random data from the "pooled" model
g<-rgraph(7)
g.p<-0.8*g+0.2*(1-g)
dat<-rgraph(7,7,tprob=g.p)
#Estimate the log Bayes Factors
b<-bbnam.bf(dat,emprior.pooled=c(3,5),epprior.pooled=c(3,5),
emprior.actor=c(3,5),epprior.actor=c(3,5))
#Print the results
b
Run the code above in your browser using DataLab