0

I have data from several subjects on what proportion of their time they spent in each quarter of a square-shaped room. Here is a sample data:

a <- rmultinom(12, 100, c(0.1, 0.4, 0.3, 0.2))
a / apply(a,2,sum)

### not running, but I would like to have something like this
# glm(a ~ 1, family=multinomial("logit")

I would be interested in the intercept, as my expectation is that they will spend most of their time in e.g. quarter 2.

Agoston T
  • 173
  • 1
  • 4

1 Answers1

0

As stated in the documentation for the stats package, there is no glm family = multinomial. glm does not fit this type of model. Perhaps the glmnet or nnet packages will suit your needs.

There are several resources on this topic. For example, the following tutorial is the first result from a google search using the criteria: r multinomial regression.

jobou
  • 74
  • 4