r - "Error in if (abs(x - oldx) < ftol)" when using "lognormal" distribution in mixed logit -
i have question how use mlogit package in r analysis of discrete choice survey data. our survey asking people choose different insurance policies(with 2 attributes of deductible , premium).
the code used fit mixed logit is:
[1] ml <- mlogit.data (mydata, choice="choice", shape = "wide", id = "individual", opposite =c ('deductible', 'premium'),varying = 5:10) [2] ml.w5 <- mlogit (choice~deductible+premium|0, ml, panel = true, rpar = c(deductible='ln', premium='ln'), r = 100, halton = na, print.level=0)
i try use lognormal because hope coefficients both deductible , premium negative. , use "opposite" in [1] reverse sign because lognormal positive.
but error warning:
"error in if (abs(x - oldx) < ftol) { : missing value true/false needed in addition: warning message: in log(start[ln]) : nans produced"
i double check data , sure there isn't missing data. , if change lognormal "ln" "n" or "cn", work without warning.
does know how deal this? thank help.
Comments
Post a Comment