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"), ...)

Arguments

object

An object of class inheriting "netlm" or "netlogit"

newdata

A design matrix with the same columns/variables as the fitted model.

...

Additional arguments (not used).

type

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).

Value

A numeric vector of predicted values.

Examples

networkers <- ison_networkers |> to_subgraph(Discipline == "Sociology")
model1 <- net_regression(weight ~ ego(Citations) + alter(Citations) + sim(Citations),
                      networkers, times = 20)
# Should be run many more `times` for publication-ready results
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)
# Should be run many more `times` for publication-ready results
predict(model1, matrix(c(1,10,5,2),1,4))
#> [1] 3.023694