Predict methods for network regression
# S3 method for class 'netlm'
predict(object, newdata = NULL, ...)
# S3 method for class 'netlogit'
predict(object, newdata = NULL, type = c("link", "response"), ...)An object of class inheriting "netlm" or "netlogit"
A design matrix with the same columns/variables as the fitted model.
Additional arguments (not used).
Character string, one of "response" (default, whether the returned predictions are on the probability scale) or "link" (returned predictions are on the scale of the linear predictor).
A numeric vector of predicted values.
networkers <- ison_networkers %>% to_subgraph(Discipline == "Sociology")
model1 <- net_regression(weight ~ ego(Citations) + alter(Citations) + sim(Citations),
networkers, times = 20)
predict(model1, matrix(c(1,10,5,2),1,4))
#> [1] 78.27843
networkers <- ison_networkers %>% to_subgraph(Discipline == "Sociology") %>%
to_unweighted()
model1 <- net_regression(. ~ ego(Citations) + alter(Citations) + sim(Citations),
networkers, times = 20)
predict(model1, matrix(c(1,10,5,2),1,4))
#> [1] 3.023694