Hi,
I would like to estimate standard errors of average marginal effects. I am running a MXL model on a DCE where participants could choose an option between three different contracts (A, B or C).
I estimated average marginal effects following the example http://apollochoicemodelling.com/files/ ... variates.r . I have dummy variables so my code is the following:
### Use the estimated model to make predictions
predictions_base = apollo_prediction(model, apollo_probabilities, apollo_inputs)
### Level change (env_C=1 to env_C=2)
database$env_C = 2
### Rerun predictions with the new data
apollo_inputs = apollo_validateInputs()
predictions_new = apollo_prediction(model, apollo_probabilities, apollo_inputs)
### Return to original data
database$env_C = 1
apollo_inputs = apollo_validateInputs()
### Compute change in probabilities
change=predictions_new-predictions_base
change=change[,-ncol(change)]
change=change[,-c(1,2)]
### Mean of changes to compute average marginal effects
mean(change$contratC)
mean(change$contratA)
mean(change$contratB)
Ideally, I would like to apply the Delta-method to get the estimate standard errors of the average marginal effect. From what I understood from the manual the function apollo_deltaMethod can be apply to model parameters. However, I do not know how to apply the Delta-method to my expression of interest which is change=predictions_new-predictions_base. Is it possible to do it? Do you have any recommendation on the procedure to follow?
Besides, I read in the manual that “In addition, an optional setting called runs has been included that computes standard errors across multiple prediction runs based on different draws from the estimates and covariance matrix for the model parameters”. However, I do not know how to easily access standard errors values? The result retuned by the function do not specify standard errors if I am not mistaken?
Thank you for your help,
Marie
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. We check the forum at least twice a week. It may thus take a couple of days for your post to appear and before we reply. There is no need to submit the post multiple times.
standard errors of average marginal effects
-
- Site Admin
- Posts: 1295
- Joined: 24 Apr 2020, 16:29
Re: standard errors of average marginal effects
Marie
have a look at the help file for apollo_prediction. If you run it with the runs setting, it will produce an array for you with the runs at different draws from the asymptotic parameter distribution and you can then use those to calculate standard errors for your marginal effects
Stephane
have a look at the help file for apollo_prediction. If you run it with the runs setting, it will produce an array for you with the runs at different draws from the asymptotic parameter distribution and you can then use those to calculate standard errors for your marginal effects
Stephane
-
- Posts: 12
- Joined: 24 Aug 2020, 15:07
- Location: Brazil
- Contact:
Re: standard errors of average marginal effects
Hi Stephane,
I'm currently working on a paper where we estimated a multivariate ordered logit model with three dependent variables, using the mvord package instead of apollo. We are in the process of revising the paper for a journal, and one of the reviewers has requested confidence intervals for the elasticities of the model.
I attended your course in Leeds in 2022 and have searched through various choice modeling manuals, handbooks, and papers, but I haven't found any discussion on this topic. I'd like to know how to compute the standard error for the elasticities of this model. From the discussions here, I understand that I need to compute the probabilities multiple times using different seeds and then calculate the standard error as SE = Std/sqrt(n). Is this correct? Could you point me to any references or examples that could help?
Thank you in advance!
Best, Gabriel
I'm currently working on a paper where we estimated a multivariate ordered logit model with three dependent variables, using the mvord package instead of apollo. We are in the process of revising the paper for a journal, and one of the reviewers has requested confidence intervals for the elasticities of the model.
I attended your course in Leeds in 2022 and have searched through various choice modeling manuals, handbooks, and papers, but I haven't found any discussion on this topic. I'd like to know how to compute the standard error for the elasticities of this model. From the discussions here, I understand that I need to compute the probabilities multiple times using different seeds and then calculate the standard error as SE = Std/sqrt(n). Is this correct? Could you point me to any references or examples that could help?
Thank you in advance!
Best, Gabriel
-
- Site Admin
- Posts: 1295
- Joined: 24 Apr 2020, 16:29
Re: standard errors of average marginal effects
Hi
in apollo, you would just run predictions with the runs setting which would take draws of the estimates using the MLE and the asymptotic variance-covariance matrix. WIth the package you're using, you would I guess have to programme that process manually
Stephane
in apollo, you would just run predictions with the runs setting which would take draws of the estimates using the MLE and the asymptotic variance-covariance matrix. WIth the package you're using, you would I guess have to programme that process manually
Stephane