No problem.
There are 4 models. Each has a dependent variable that may exist in the other 4 models. To solve this issue we incorporate a mixed logit model to account for their errors. So they are not independent and independent within the same model.
Important: Read this before posting to this forum
- This forum is for questions related to the use of Apollo. We will answer some general choice modelling questions too, where appropriate, and time permitting. We cannot answer questions about how to estimate choice models with other software packages.
- There is a very detailed manual for Apollo available at http://www.ApolloChoiceModelling.com/manual.html. This contains detailed descriptions of the various Apollo functions, and numerous examples are available at http://www.ApolloChoiceModelling.com/examples.html. In addition, help files are available for all functions, using e.g. ?apollo_mnl
- Before asking a question on the forum, users are kindly requested to follow these steps:
- Check that the same issue has not already been addressed in the forum - there is a search tool.
- Ensure that the correct syntax has been used. For any function, detailed instructions are available directly in Apollo, e.g. by using ?apollo_mnl for apollo_mnl
- Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
- Make sure that R is using the latest official release of Apollo.
- Users can check which version they are running by entering packageVersion("apollo").
- Then check what is the latest full release (not development version) at http://www.ApolloChoiceModelling.com/code.html.
- To update to the latest official version, just enter install.packages("apollo"). To update to a development version, download the appropriate binary file from http://www.ApolloChoiceModelling.com/code.html, and install the package from file
- If the above steps do not resolve the issue, then users should follow these steps when posting a question:
- provide full details on the issue, including the entire code and output, including any error messages
- posts will not immediately appear on the forum, but will be checked by a moderator first. This may take a day or two at busy times. There is no need to submit the post multiple times.
Search found 14 matches
- 25 Apr 2023, 13:17
- Forum: Errors during model validation and/or estimation.
- Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
- Replies: 9
- Views: 2084
- 02 Feb 2023, 15:11
- Forum: Errors during model validation and/or estimation.
- Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
- Replies: 9
- Views: 2084
Re: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
The 4 models each has a dependent variables. Each of the 4 model uses the other models' dependent variables as independent variables. This is why the mixed logit is done. Since not all of these were significant, in some of these models, one or more variables are omitted. Could the error be that I al...
- 20 Jan 2023, 16:37
- Forum: Errors during model validation and/or estimation.
- Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
- Replies: 9
- Views: 2084
- 19 Jan 2023, 15:18
- Forum: Errors during model validation and/or estimation.
- Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
- Replies: 9
- Views: 2084
Re: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
To rephrase my last message. It worked in the sense that it is not producing an error, but all my t-ratios and p-values are NaN now.
Could you tell me if it's a problem with the data or a problem with the code?
Could you tell me if it's a problem with the data or a problem with the code?
- 16 Jan 2023, 16:39
- Forum: Errors during model validation and/or estimation.
- Topic: Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
- Replies: 9
- Views: 2084
Getting error: Error in maxOptim(fn=fn, grad=grad, hess=hess, start=start, method="BFGS",:NA in the initial gradient
I get the error: Error in maxOptim(fn = fn, grad = grad, hess = hess, start = start, method = "BFGS", : NA in the initial gradient In addition: There were 26 warnings (use warnings() to see them) When running my model. I could not find any google answers to solve it. Any help would be grea...
- 05 Jan 2023, 15:04
- Forum: Model specification
- Topic: Error when compiling utility function into a variable
- Replies: 1
- Views: 3766
Error when compiling utility function into a variable
I have this code below that works: library(apollo) library(haven) library(plyr) library(dplyr) library(labelled) library(tidyverse) randstad <- c( #b_randstad_is = 0, b_randstad_not = 0, b_randstad_to = 0, b_randstad_from = 0 ) wdist <- c( b_weekdist_dec = 0, b_weekdist_inc = 0, b_weekdist_same = 0,...
- 14 Dec 2022, 17:21
- Forum: Model specification
- Topic: More efficient way of doing a step-wise approach?
- Replies: 1
- Views: 922
More efficient way of doing a step-wise approach?
I have a model with a lot of dummy variables. There are about 6 control variables - each with on average 5 dummies. the 6 control variables leaves 63 combinations of models. My process right now would look like commenting off each variable individually and running the model. Is there any way to auto...
- 11 Aug 2022, 13:45
- Forum: Errors during model validation and/or estimation.
- Topic: Error when using mixed logit with only one observation per individual
- Replies: 6
- Views: 3125
Re: Error when using mixed logit with only one observation per individual
Got it to work. Solution confirmed.
- 10 Aug 2022, 16:17
- Forum: Errors during model validation and/or estimation.
- Topic: Error when using mixed logit with only one observation per individual
- Replies: 6
- Views: 3125
Re: Error when using mixed logit with only one observation per individual
What goes into that call? And where do I add it?
- 09 Aug 2022, 14:29
- Forum: Errors during model validation and/or estimation.
- Topic: Error when using mixed logit with only one observation per individual
- Replies: 6
- Views: 3125
Error when using mixed logit with only one observation per individual
Hello I am trying to build a mixed ordered logit model with a random error term. This is my model: #### nautos #### # ################################################################# # #### LOAD LIBRARY AND DEFINE CORE SETTINGS #### # ################################################################...