data(faux.mesa.high)
formula <- faux.mesa.high ~ edges + nodematch("Sex") + nodefactor("Grade")
mplesetup <- ergmMPLE(formula)
# Obtain MPLE coefficients "by hand":
glm(mplesetup$response ~ . - 1, data = data.frame(mplesetup$predictor),
weights = mplesetup$weights, family="binomial")$coefficients
# Check that the coefficients agree with the output of the ergm function:
ergmMPLE(formula, fitmodel=TRUE)$coef
Run the code above in your browser using DataLab