0

I would like to use the mlogit package to fit a logit model. However I only have a dataframe which contains aggregated sales data. Any Ideas of how to go from aggregated form to a form on individual level.

an example to work on:

library(mlogit)
library(dplyr)
data(Car)
#make a an aggregated dataframe
car2 <- group_by(Car,type1,fuel1,range1) %>% summarise(sales=n())

head(car2)
Source: local data frame [6 x 4]
Groups: type1, fuel1 [2]

   type1    fuel1 range1 sales
  <fctr>   <fctr>  <dbl> <int>
1 regcar methanol     50   110
2 regcar methanol     75   180
3 regcar methanol    125  1138
4 regcar methanol    200   945
5 regcar      cng     75   307

Now from here I would like to produce a dataframe on individual level in order to fit a logit model with mlogit

Or for that matter if any other idea on modeling a logit from aggregated sales data.

Thanks

jonas
  • 13,559
  • 22
  • 57
  • 75
  • This topic is probably more appropriate for [crossValidated](http://stats.stackexchange.com/) as it relates to statistical methodology. Not sure if this carries through to logit models, but in OLS, you can use population weights to achieve individual-level estimates from aggregated data. – lmo Feb 09 '17 at 14:47
  • Did you find the solution to your question? – deepAgrawal Dec 19 '17 at 23:37

0 Answers0