svymultinom uses the withReplicates function to compute the replicate-based estimate of the variance-covariance matrix of coefficients for a multinomial regression fitted by multinom.

svymultinom(formula = NULL, weights = NULL, data = NULL)

# S3 method for svymultinom
coef(object, ...)

# S3 method for svymultinom
vcov(object, ...)

# S3 method for svymultinom
formula(x, ...)

# S3 method for svymultinom
predict(object, ...)

# S3 method for svymultinom
model.frame(formula, ...)

# S3 method for svymultinom
print(x, ...)

# S3 method for svymultinom
summary(object, ...)

# S3 method for summary.svymultinom
print(x, digits = 4, ...)

# S3 method for svymultinom
update(object, ..., evaluate = TRUE)

Arguments

formula

regression formula

weights

weights for regression

data

dataset for regression

object

an object of class 'svymultinom'

...

additional arguments

x

an object of class 'svymultinom'

digits

minimal number of significant digits. See print.default.

evaluate

a logical value. If TRUE, the updated call is evaluated. Default is TRUE.

Value

An object of class svymultinom is returned:

call

the function call,

NAIVEreg

the naive multinomial regression object,

vcov

the replicate-based estimate of the variance-covariance matrix of coefficients,

...

Methods (by generic)

Functions

See also

Examples

if (FALSE) { rm(list=ls()) library(CMAverse) # multinom n <- 1000 x1 <- rnorm(n, mean = 0, sd = 1) x2 <- rnorm(n, mean = 1, sd = 1) x3 <- rbinom(n, size = 1, prob = 0.4) linearpred1 <- 1 + 0.3 * x1 - 0.5 * x2 - 0.2 * x3 linearpred2 <- 2 + 1 * x1 - 2 * x2 - 1 * x3 py2 <- exp(linearpred1) / (1 + exp(linearpred1) + exp(linearpred2)) py3 <- exp(linearpred2) / (1 + exp(linearpred1) + exp(linearpred2)) py1 <- 1 - py2 - py3 y <- sapply(1:n, function(x) sample(size = 1, c(1:3), prob = c(py1[x], py2[x], py3[x]))) w <- ifelse(x3 == 0, 0.4, 0.6) data <- data.frame(x1 = x1, x2 = x2, x3 = x3, y = y) reg <- svymultinom(y ~ x1 + x2 + x3, weights = w, data = data) coef(reg) vcov(reg) formula(reg) predict(reg, newdata = data[1, ], type = "probs") model.frame(reg) summary(reg) update(reg, weights = w[1:500], data = data[1:500, ]) }