prop.multinom: Proportions and standard errors

View source: R/prop.multinom.R

prop.multinomR Documentation

Proportions and standard errors

Description

Computes proportions (and their standard errors) when the number of classes is >= 2, based on predicted values of a model. The function is intended to be used parallel to a multinomial log-linear model.

Usage

prop.multinom(x)

Arguments

x

either a factor or a matrix with K columns giving the counts for each of the K classes.

Details

The proportions can be computed through the predict function applied on a multinomial log-linear model (see multinom). However, standard errors (or confidence intervals) cannot be obtained this way. The present function uses differents GLMs (in each case considering one category vs. the sum of all others) to obtain proportions and standard errors. Overdispersion is taken into account by default, using a quasibinomial law in all GLMs built.

Value

probs

the calculated proportions.

se

the calculated standard errors.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

See Also

multinom, glm

Examples

response <- data.frame(A=c(2,2,4,0,2,14,6,16,0,0),
			     B=c(2,0,0,0,6,2,10,6,0,0),
			     C=c(12,6,0,6,2,0,0,0,0,0),
			     D=c(0,0,0,14,0,0,0,0,2,0),
			     E=c(0,0,0,0,0,0,0,0,16,15))
prop.multinom(response)

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.