Learn R Programming

RVAideMemoire (version 0.9-83-7)

prop.multinom: 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)

Value

probs

the calculated proportions.

se

the calculated standard errors.

Arguments

x

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

Author

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

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.

See Also

Examples

Run this code
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)

Run the code above in your browser using DataLab