-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rhistory
512 lines (512 loc) · 17.6 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
}
sz.col <- unique(structzero.df[structzero.df$where ==
"col", -3])
szcolnum <- numeric(length(l$networks))
for (i in 1:length(l$networks)) {
szcolnum[i] <- nrow(sz.col[sz.col$time == i,
])
}
totrow <- sapply(l$networks, function(x) nrow(as.matrix(x)))
totcol <- sapply(l$networks, function(x) ncol(as.matrix(x)))
if (offset == TRUE) {
dimensions <- rbind(totrow, totcol, szrownum,
szcolnum, totrow - szrownum, totcol - szcolnum)
rownames(dimensions) <- c("total number of rows",
"total number of columns", "row-wise structural zeros",
"column-wise structural zeros", "remaining rows",
"remaining columns")
}
else {
dimensions <- rbind(szrownum, szcolnum, totrow -
szrownum, totcol - szcolnum)
rownames(dimensions) <- c("maximum deleted nodes (row)",
"maximum deleted nodes (col)", "remaining rows",
"remaining columns")
}
colnames(dimensions) <- paste0("t=", t.start:t.end)
if (nrow(structzero.df) > 0) {
if (offset == TRUE) {
message("\nNodes affected completely by structural zeros:")
}
else {
message("\nAbsent nodes:")
}
szcopy <- structzero.df
szcopy$time <- szcopy$time - 1 + t.start
print(unique(szcopy))
}
else {
message("\nAll nodes are retained.")
}
message("\nNumber of nodes per time step after adjustment:")
print(dimensions)
}
}
l$nvertices <- sapply(l$networks, function(x) c(nrow(as.matrix(x)),
ncol(as.matrix(x))))
rownames(l$nvertices) <- c("row", "col")
colnames(l$nvertices) <- paste0("t=", t.start:t.end)
l$offsmat <- list()
for (i in 1:l$time.steps) {
mat <- matrix(0, nrow = nrow(as.matrix(l$networks[[i]])),
ncol = ncol(as.matrix(l$networks[[i]])))
rownames(mat) <- rownames(as.matrix(l$networks[[i]]))
colnames(mat) <- colnames(as.matrix(l$networks[[i]]))
l$offsmat[[i]] <- mat
}
if (nrow(structzero.df) > 0) {
for (i in 1:nrow(structzero.df)) {
if (structzero.df$where[i] == "row") {
index <- which(rownames(l$offsmat[[structzero.df$time[i]]]) ==
structzero.df$label[i])
l$offsmat[[structzero.df$time[i]]][index, ] <- 1
}
else {
index <- which(colnames(l$offsmat[[structzero.df$time[i]]]) ==
structzero.df$label[i])
l$offsmat[[structzero.df$time[i]]][, index] <- 1
}
}
}
if (offset == TRUE) {
l$rhs.terms[length(l$rhs.terms) + 1] <- "offset(edgecov(offsmat[[i]]))"
rhs.operators[length(rhs.operators) + 1] <- "+"
}
else {
if (l$auto.adjust == TRUE) {
l$offsmat <- suppressMessages(btergm::handleMissings(l$offsmat,
na = 1, method = "remove"))
for (j in 1:length(l$covnames)) {
l[[l$covnames[j]]] <- btergm::adjust(l[[l$covnames[j]]],
l$offsmat)
}
}
}
if (verbose == TRUE && length(l$covnames) > 1) {
dimensions <- lapply(lapply(l$covnames, function(x) l[[x]]),
function(y) sapply(y, function(z) dim(as.matrix(z))))
rownames(dimensions[[1]]) <- paste(l$lhs.original, c("(row)",
"(col)"))
for (i in 2:length(dimensions)) {
rownames(dimensions[[i]]) <- c(paste(l$covnames[i],
"(row)"), paste(l$covnames[i], "(col)"))
}
dimensions <- do.call(rbind, dimensions)
colnames(dimensions) <- paste0("t=", t.start:t.end)
message("\nDimensions of the network and covariates after adjustment:")
print(dimensions)
}
rhs <- l$rhs.terms[1]
if (length(rhs.operators) > 0) {
for (i in 1:length(rhs.operators)) {
rhs <- paste(rhs, rhs.operators[i], l$rhs.terms[i +
1])
}
}
f <- paste(lhs, tilde, rhs)
l$form <- stats::as.formula(f, env = environment())
if (blockdiag == TRUE) {
if (l$bipartite == TRUE) {
stop(paste("MCMC estimation is currently only supported for one-mode",
"networks. Use the btergm function instead."))
}
l$form <- stats::update.formula(l$form, networks ~ .)
l$form <- paste(deparse(l$form), collapse = "")
l$form <- paste(l$form, "+ offset(edgecov(offsmat))")
l$form <- stats::as.formula(l$form, env = environment())
if (length(l$covnames) > 1) {
for (j in 2:length(l$covnames)) {
l[[l$covnames[j]]] <- as.matrix(Matrix::bdiag(lapply(l[[l$covnames[j]]],
as.matrix)))
}
}
l$offsmat <- as.matrix(Matrix::bdiag(l$offsmat))
bdoffset <- lapply(l$networks, as.matrix)
for (i in 1:length(bdoffset)) {
bdoffset[[i]][, ] <- 1
}
bdoffset <- as.matrix((Matrix::bdiag(bdoffset) - 1) *
-1)
l$offsmat <- l$offsmat + bdoffset
rm(bdoffset)
l$offsmat[l$offsmat > 0] <- 1
if (class(l$networks[[1]]) == "network") {
attrnames <- network::list.vertex.attributes(l$networks[[1]])
attributes <- list()
for (i in 1:length(l$networks)) {
attrib <- list()
for (j in 1:length(attrnames)) {
attrib[[j]] <- network::get.vertex.attribute(l$networks[[i]],
attrnames[j])
}
attributes[[i]] <- attrib
l$networks[[i]] <- as.matrix(l$networks[[i]])
}
l$networks <- network::network(as.matrix(Matrix::bdiag(l$networks)),
directed = l$directed, bipartite = l$bipartite)
for (i in 1:length(attrnames)) {
attrib <- unlist(lapply(attributes, function(x) x[[i]]))
network::set.vertex.attribute(l$networks, attrnames[i],
attrib)
}
}
else {
l$networks <- network::network(as.matrix(Matrix::bdiag(l$networks)),
directed = l$directed, bipartite = l$bipartite)
}
if (verbose == TRUE) {
cat("\n")
}
}
form3 <- paste(deparse(l$form[[3]]), collapse = "")
form3 <- gsub("\\s+", " ", form3)
l$form <- paste(deparse(l$form[[2]]), deparse(l$form[[1]]),
form3)
return(l)
}
#' Check if a matrix is a one-mode matrix
#'
#' Check if a matrix is a one-mode matrix.
#'
#' @param mat A matrix object containing zeros and ones.
#' @return \code{TRUE} if the input matrix \code{mat} represents a one-mode
#' network and \code{FALSE} otherwise.
#'
#' @noRd
is.mat.onemode <- function(mat) {
if (nrow(mat) != ncol(mat)) {
return(FALSE)
} else if (!is.null(rownames(mat)) && !is.null(colnames(mat))
&& any(rownames(mat) != colnames(mat))) {
return(FALSE)
} else {
return(TRUE)
}
}
#' Check if a matrix represents a directed network
#'
#' Check if a matrix represents a directed network.
#'
#' @param mat A matrix object containing zeros and ones.
#' @return \code{TRUE} if the input matrix \code{mat} represents a directed
#' network and \code{FALSE} otherwise.
#'
#' @noRd
is.mat.directed <- function(mat) {
if (nrow(mat) != ncol(mat)) {
return(FALSE)
} else if (!is.null(rownames(mat)) && !is.null(colnames(mat))
&& any(rownames(mat) != colnames(mat), na.rm = TRUE)) {
return(FALSE)
} else {
if (any(as.matrix(mat) != t(as.matrix(mat)), na.rm = TRUE)) {
return(TRUE)
} else {
return(FALSE)
}
}
}
ergm.AME(TERGM_1,var1="nodeifactor.gender.2")
ergm.AME(TERGM_1,var1="nodeofactor.gender.2")
ergm.AME(TERGM_1,var1="nodeifactor.gender.2",var2="nodeofactor.gender.2",inter="nodematch.gender")
ergm.AME(TERGM_1,var1="nodeifactor.smoking.2")
ergm.AME(TERGM_1,var1="nodeofactor.smoking.2")
ergm.AME(TERGM_1,var1="nodeifactor.smoking.2",var2="nodeofactor.smoking.2",inter="nodematch.smoking")
ergm.AME(TERGM_1,var1="nodeicov.program")
ergm.AME(TERGM_1,var1="nodeocov.program")
ergm.AME(TERGM_1,var1="nodeocov.program",var2="nodeicov.program",inter="absdiff.program")
ergm.AME(TERGM_1,var1="edgecov.delrecip")
ergm.AME(TERGM_1,var1="gwesp.fixed.0.7")
ergm.AME(TERGM_1,var1="gwidegree.fixed.0.6")
summary(TERGM_1)
###run the model
set.seed(21093) ###set seed so that results replicate
###estimate the model
TERGM_1<-mtergm(vandebunt~edges+ #equivalent to intercept
nodeifactor("gender")+ #receiver effect of gender
nodeofactor("gender")+ #sender effect of gender
nodematch("gender")+ #same gender
nodeifactor("smoking")+ #receiver effect of smoking
nodeofactor("smoking")+ #sender effect of smoking
nodematch("smoking")+ #same smoking behavior
nodeicov("program")+ ##receiver effect for program
nodeocov("program")+ ##sender effect for program
absdiff("program")+ ##absolute difference for program
delrecip+ #delayed reciprocity
gwesp(.7,fixed=T)+ ###geometrically weighted edgewise shared partnership
gwidegree(.6,fixed=T),##geometrically weighted indegree distribution
control=control.ergm(parallel=3, #run on 3 processors to speed up estimation
MCMC.samplesize = 3000, #increase MCMC sample size to improve convergence
MCMLE.maxit=7)
)
TERGM_1<-mtergm(vandebunt~edges+ #equivalent to intercept
nodeifactor("gender")+ #receiver effect of gender
nodeofactor("gender")+ #sender effect of gender
nodematch("gender")+ #same gender
nodeifactor("smoking")+ #receiver effect of smoking
nodeofactor("smoking")+ #sender effect of smoking
nodematch("smoking")+ #same smoking behavior
nodeicov("program")+ ##receiver effect for program
nodeocov("program")+ ##sender effect for program
absdiff("program")+ ##absolute difference for program
delrecip+ #delayed reciprocity
gwesp(.7,fixed=T)+ ###geometrically weighted edgewise shared partnership
gwidegree(.7,fixed=T),##geometrically weighted indegree distribution
control=control.ergm(parallel=3, #run on 3 processors to speed up estimation
MCMC.samplesize = 3000, #increase MCMC sample size to improve convergence
MCMLE.maxit=6)
)
###run the model
set.seed(21093) ###set seed so that results replicate
###estimate the model
TERGM_1<-mtergm(vandebunt~edges+ #equivalent to intercept
nodeifactor("gender")+ #receiver effect of gender
nodeofactor("gender")+ #sender effect of gender
nodematch("gender")+ #same gender
nodeifactor("smoking")+ #receiver effect of smoking
nodeofactor("smoking")+ #sender effect of smoking
nodematch("smoking")+ #same smoking behavior
nodeicov("program")+ ##receiver effect for program
nodeocov("program")+ ##sender effect for program
absdiff("program")+ ##absolute difference for program
delrecip+ #delayed reciprocity
gwesp(.7,fixed=T)+ ###geometrically weighted edgewise shared partnership
gwidegree(.7,fixed=T),##geometrically weighted indegree distribution
control=control.ergm(parallel=3, #run on 3 processors to speed up estimation
MCMC.samplesize = 3000, #increase MCMC sample size to improve convergence
MCMLE.maxit=5)
)
summary(TERGM_1)
library(ergMargins)
ergm.AME(TERGM_1,var1="nodeifactor.gender.2")
ergm.AME(TERGM_1,var1="nodeofactor.gender.2")
ergm.AME(TERGM_1,var1="nodeifactor.gender.2",var2="nodeofactor.gender.2",inter="nodematch.gender")
ergm.AME(TERGM_1,var1="nodeifactor.smoking.2")
ergm.AME(TERGM_1,var1="nodeofactor.smoking.2")
ergm.AME(TERGM_1,var1="nodeifactor.smoking.2",var2="nodeofactor.smoking.2",inter="nodematch.smoking")
ergm.AME(TERGM_1,var1="nodeicov.program")
ergm.AME(TERGM_1,var1="nodeocov.program")
ergm.AME(TERGM_1,var1="nodeocov.program",var2="nodeicov.program",inter="absdiff.program")
ergm.AME(TERGM_1,var1="edgecov.delrecip")
ergm.AME(TERGM_1,var1="gwesp.fixed.0.7")
ergm.AME(TERGM_1,var1="gwidegree.fixed.0.6")
devtools::build()
devtools::check()
vif.ergm<-function(my.ergm){
if(class(my.ergm)%in%"btergm"){
data_mat<-my.ergm@effects
corr5<-stats::cor(data_mat[!rownames(data_mat)%in%"edges",
!colnames(data_mat)%in%"edges"]) ##omit edges term
beta<-btergm:::coef(my.ergm)
}else{
#get correlation matrix
if(class(my.ergm)%in%"mlergm"){
cor.mat<-stats::cov2cor(solve(my.ergm$information_matrix))
beta<-my.ergm$theta
}else{
cor.mat<-stats::cov2cor(my.ergm$covar) #calculate correlation matrix
beta<-ergm:::coef.ergm(my.ergm)
}
#omit edges, assign names to matrix
rownames(cor.mat)<-colnames(cor.mat)<-names(beta)
corr5<-cor.mat[!rownames(cor.mat)%in%"edges",
!colnames(cor.mat)%in%"edges"]
}
corr5<-corr5[!is.na(corr5[1:nrow(corr5)]),]
corr5<-corr5[,which(!is.na(corr5[1,1:ncol(corr5)]))]
VIFS<-matrix(0,nrow=1,ncol=ncol(corr5))
for(i in 1:ncol(corr5)){
gvec<-as.vector(corr5[-c(i),i]) ##create vector of correlations between covariate of interest and other covariates in the model
tgvec<-t(gvec)
xcor<-solve(corr5[-c(i),-c(i)]) ##create square matrix of correlations between covariates in the model other than the one of interest
Rsq<-tgvec%*%xcor%*%gvec
VIFS[1,i]<-1/(1-Rsq)
}
colnames(VIFS)<-names(beta[!names(beta)%in%"edges"])
if(class(my.ergm)%in%"btergm"){
warning("VIFS for bootstrap TERGM based on model matrix, not the covariance matrix of the estimator. Benchmarks used for MCMC ML estimation may not apply.")
}else{
message("Higher values indicate greater correlation.\nVIF > 20 is concerning, VIF > 100 indicates severe collinearity.")
}
VIFS
}
library(btergm)
networks <- list()
for (i in 1:10) { # create 10 random networks with 10 actors
mat <- matrix(rbinom(100, 1, .25), nrow = 10, ncol = 10)
diag(mat) <- 0 # loops are excluded
nw <- network::network(mat) # create network object
networks[[i]] <- nw # add network to the list
}
covariates <- list()
for (i in 1:10) { # create 10 matrices as covariate
mat <- matrix(rnorm(100), nrow = 10, ncol = 10)
covariates[[i]] <- mat # add matrix to the list
}
fit <- btergm(networks ~ edges + istar(2) + edgecov(covariates), R = 100)
summary(fit) # show estimation results
###VIF for btergm
VIF.ERGM_BS<-function(my.ergm){
require(ergm)
data_mat<-my.ergm@effects
corr5<-cor(data_mat[!rownames(data_mat)%in%"edges",
!colnames(data_mat)%in%"edges"]) ##omit edges term
corr5<-corr5[!is.na(corr5[1:nrow(corr5)]),]
corr5<-corr5[,which(!is.na(corr5[1,1:ncol(corr5)]))]
VIFS<-matrix(0,nr=1,nc=ncol(corr5))
for(i in 1:ncol(corr5)){
gvec<-as.vector(corr5[-c(i),i]) ##create vector of correlations between covariate of interest and other covariates in the model
tgvec<-t(gvec)
xcor<-solve(corr5[-c(i),-c(i)]) ##create square matrix of correlations between covariates in the model other than the one of interest
Rsq<-tgvec%*%xcor%*%gvec
VIFS[1,i]<-1/(1-Rsq)
}
colnames(VIFS)<-names(my.ergm@coef[!names(my.ergm@coef)%in%"edges"])
VIFS
}
##check the results
VIF.ERGM_BS(fit)
model2<-ergm(faux.mesa.high~edges+
nodematch("Race")+
nodecov("Grade"),#+
control = control.ergm(MCMLE.maxit = 2))
data("faux.mesa.high")
model2<-ergm(faux.mesa.high~edges+
nodematch("Race")+
nodecov("Grade"),#+
control = control.ergm(MCMLE.maxit = 2))
vif.ergm(model2)
stats::coef(model2)
model2<-ergm(faux.mesa.high~edges+
nodematch("Race")+
nodecov("Grade")+
gwesp(fixed=T,.7),
control = control.ergm(MCMLE.maxit = 2))
ergm:::coef.ergm(model2)
stats::coef(model2)
stats::coef(fit)
vif.ergm<-function(my.ergm){
if(class(my.ergm)%in%"btergm"){
data_mat<-my.ergm@effects
corr5<-stats::cor(data_mat[!rownames(data_mat)%in%"edges",
!colnames(data_mat)%in%"edges"]) ##omit edges term
beta<-btergm:::coef(my.ergm)
}else{
#get correlation matrix
if(class(my.ergm)%in%"mlergm"){
cor.mat<-stats::cov2cor(solve(my.ergm$information_matrix))
beta<-my.ergm$theta
}else{
cor.mat<-stats::cov2cor(my.ergm$covar) #calculate correlation matrix
beta<-stats::coef.ergm(my.ergm)
}
#omit edges, assign names to matrix
rownames(cor.mat)<-colnames(cor.mat)<-names(beta)
corr5<-cor.mat[!rownames(cor.mat)%in%"edges",
!colnames(cor.mat)%in%"edges"]
}
corr5<-corr5[!is.na(corr5[1:nrow(corr5)]),]
corr5<-corr5[,which(!is.na(corr5[1,1:ncol(corr5)]))]
VIFS<-matrix(0,nrow=1,ncol=ncol(corr5))
for(i in 1:ncol(corr5)){
gvec<-as.vector(corr5[-c(i),i]) ##create vector of correlations between covariate of interest and other covariates in the model
tgvec<-t(gvec)
xcor<-solve(corr5[-c(i),-c(i)]) ##create square matrix of correlations between covariates in the model other than the one of interest
Rsq<-tgvec%*%xcor%*%gvec
VIFS[1,i]<-1/(1-Rsq)
}
colnames(VIFS)<-names(beta[!names(beta)%in%"edges"])
if(class(my.ergm)%in%"btergm"){
warning("VIFS for bootstrap TERGM based on model matrix, not the covariance matrix of the estimator. Benchmarks used for MCMC ML estimation may not apply.")
}else{
message("Higher values indicate greater correlation.\nVIF > 20 is concerning, VIF > 100 indicates severe collinearity.")
}
VIFS
}
vif.ergm(model2)
vif.ergm<-function(my.ergm){
if(class(my.ergm)%in%"btergm"){
data_mat<-my.ergm@effects
corr5<-stats::cor(data_mat[!rownames(data_mat)%in%"edges",
!colnames(data_mat)%in%"edges"]) ##omit edges term
beta<-btergm:::coef(my.ergm)
}else{
#get correlation matrix
if(class(my.ergm)%in%"mlergm"){
cor.mat<-stats::cov2cor(solve(my.ergm$information_matrix))
beta<-my.ergm$theta
}else{
cor.mat<-stats::cov2cor(my.ergm$covar) #calculate correlation matrix
beta<-stats::coef(my.ergm)
}
#omit edges, assign names to matrix
rownames(cor.mat)<-colnames(cor.mat)<-names(beta)
corr5<-cor.mat[!rownames(cor.mat)%in%"edges",
!colnames(cor.mat)%in%"edges"]
}
corr5<-corr5[!is.na(corr5[1:nrow(corr5)]),]
corr5<-corr5[,which(!is.na(corr5[1,1:ncol(corr5)]))]
VIFS<-matrix(0,nrow=1,ncol=ncol(corr5))
for(i in 1:ncol(corr5)){
gvec<-as.vector(corr5[-c(i),i]) ##create vector of correlations between covariate of interest and other covariates in the model
tgvec<-t(gvec)
xcor<-solve(corr5[-c(i),-c(i)]) ##create square matrix of correlations between covariates in the model other than the one of interest
Rsq<-tgvec%*%xcor%*%gvec
VIFS[1,i]<-1/(1-Rsq)
}
colnames(VIFS)<-names(beta[!names(beta)%in%"edges"])
if(class(my.ergm)%in%"btergm"){
warning("VIFS for bootstrap TERGM based on model matrix, not the covariance matrix of the estimator. Benchmarks used for MCMC ML estimation may not apply.")
}else{
message("Higher values indicate greater correlation.\nVIF > 20 is concerning, VIF > 100 indicates severe collinearity.")
}
VIFS
}
vif.ergm(model2)
model2<-ergm(faux.mesa.high~edges+
nodematch("Race")+
nodecov("Grade"),+
# gwesp(fixed=T,.7),
control = control.ergm(MCMLE.maxit = 2))
model2<-ergm(faux.mesa.high~edges+
nodematch("Race")+
nodecov("Grade"),
# gwesp(fixed=T,.7),
control = control.ergm(MCMLE.maxit = 2))
vif.ergm(model2)
model_est <- mlergm(classes ~ edges +
mutual +
nodematch("sex"),# +
#gwesp(fixed = T,.7),
seed = 123,
options = set_options(number_cores = 2))
library(mlergm)
model_est <- mlergm(classes ~ edges +
mutual +
nodematch("sex"),# +
#gwesp(fixed = T,.7),
seed = 123,
options = set_options(number_cores = 2))
vif.ergm(model_est)
model2<-ergm(faux.mesa.high~
nodematch("Race")+
nodecov("Grade"),
# gwesp(fixed=T,.7),
control = control.ergm(MCMLE.maxit = 2))
vif.ergm(model2)
model2<-ergm(faux.mesa.high~edges+
nodematch("Race")+
nodecov("Grade")+
nodematch("Grade"),
# gwesp(fixed=T,.7),
control = control.ergm(MCMLE.maxit = 2))
vif.ergm(model2)
model2<-ergm(faux.mesa.high~
nodematch("Race")+
nodecov("Grade")+
nodematch("Grade"),
# gwesp(fixed=T,.7),
control = control.ergm(MCMLE.maxit = 2))
vif.ergm(model2)
devtools::build()
devtools::check()