When trying the function in my use case:
model <- mlogit(choice ~ attr_1+attr_2+attr_3, ewc_df2,
child.var="DealerCode",
alt.var='altkey',
choice='choice',
shape='long')
I am getting the following error:
Error in $<-
:
! Assigned data value
must be compatible with existing data.
✖ Existing data has 18329 rows.
✖ Assigned data has 18300 rows.
ℹ Only vectors of size 1 are recycled.
Caused by error in vectbl_recycle_rhs_rows()
:
! Can't recycle input of size 18300 to size 18329.
Can't seem to find the reason why it's happening.