I am trying to use the mlogit
package to estimate a multinomial probit model, but I get the following error.
Error in if (is.null(initial.value) || lnl <= initial.value) break :
missing value where TRUE/FALSE needed
These are the statements that I used
dat <- read.table("C:\\Users\\Data.txt", header=TRUE, sep="\t", row.names=NULL)
brand <- mlogit.data(dat, shape="long", choice = "choice", varying = 3:7, sep = " ", alt.levels=1:7, id.var = "id")
brand.mprobit <- mlogit(choice ~ last + price + ad + shelf | pers_1 + pers_2 + spend, probit = TRUE)
summary(brand.mprobit)
My data looks as follows:
obs choice person option last price ad shelf pers_1 pers_2 spend ago
1 0 101 1 0 0.38 1 1 1 9 20 4
1 0 101 2 0 0.44 0 0 1 9 20 4
1 0 101 3 0 0.33 0 0 1 9 20 4
1 0 101 4 0 0.64 0 0 1 9 20 4
1 1 101 5 0 0.55 0 0 1 9 20 4
1 0 101 6 1 0.18 0 0 1 9 20 4
2 1 102 1 0 0.99 0 1 1 9 23 5
2 0 102 2 0 0.66 0 0 1 9 23 5
2 0 102 3 0 0.45 1 1 1 9 23 5
2 0 102 4 0 0.56 0 0 1 9 23 5
2 0 102 5 0 0.78 0 0 1 9 23 5
2 0 102 6 1 0.18 0 0 1 9 21 5
The last 4 columns are only individual specific, while the others are alternative specific. Could anyone please help?