View source: R/prop.multinom.R
prop.multinom | R Documentation |
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.
prop.multinom(x)
x |
either a factor or a matrix with K columns giving the counts for each of the K classes. |
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.
probs |
the calculated proportions. |
se |
the calculated standard errors. |
Maxime HERVE <maxime.herve@univ-rennes1.fr>
multinom
, glm
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.