Important: Read this before posting to this forum

  1. 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.
  2. 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
  3. Before asking a question on the forum, users are kindly requested to follow these steps:
    1. Check that the same issue has not already been addressed in the forum - there is a search tool.
    2. 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
    3. Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
    4. Make sure that R is using the latest official release of Apollo.
  4. If the above steps do not resolve the issue, then users should follow these steps when posting a question:
    1. provide full details on the issue, including the entire code and output, including any error messages
    2. 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.

Headers of Estimates.csv

Ask questions about the results reported after estimation. If the output includes errors, please include your model code if possible.
Post Reply
biancar
Posts: 5
Joined: 06 Sep 2021, 15:15

Headers of Estimates.csv

Post by biancar »

Hello,

Apologies, but I cannot find on the Apollo manual, academic paper, or on this online forum any confirmation of what the headers are for the columns in the outputted CSV file when generating model estimates. More specifically, what are the values in t-ratio(0) and t-ratio(1) referring to? I assume one-tailed and two-tailed t-test statistics, but which is which? Is t-ratio(1) the one-tailed test (because the default is not to include these in the estimation table)?

Many thanks for your help.
dpalma
Posts: 190
Joined: 24 Apr 2020, 17:54

Re: Headers of Estimates.csv

Post by dpalma »

Hi,

The columns are as follows:
  • Estimate: Value of the parameter estimate
  • Std.err.: Standard error of the parameter estimate
  • t-ratio(0): t statistic against zero, i.e. H0: b=0, H1: b!=0, where b is the parameter estimate. Calculated using b's std.err.
  • t-ratio(1): t statistic against one, i.e. H0: b=1, H1: b!=1, where b is the parameter estimate. Calculated using b's std.err.
  • Rob.std.err.: Robust standard error of the parameter estimate, i.e. calculated using the robust "sandwich" covariance matrix. See Train (2009) Discrete choice models with simulation, section 8.6.
  • t-ratio(0): t statistic against zero, i.e. H0: b=0, H1: b!=0, where b is the parameter estimate. Calculated using b's Rob.std.err.
  • t-ratio(1): t statistic against one, i.e. H0: b=1, H1: b!=1, where b is the parameter estimate. Calculated using b's Rob.std.err.
The value of the t-statistic will be the same regardless if you want to do the test with one or two tails. The significance of the test however, i.e. its p-value, will change depending on the number of tails considered. For example, a t-statistic (or t-ratio, as it is called in Apollo) of 1.96 has a p-value of 0.05 for the two-tails test, and a value of 0.025 for the single tail test.

By default, Apollo does not output p-values, but you can ask for them when calling apollo_modelOutput (to output results to screen) or apollo_saveOutput (to save the results to a file) with the following additional options:

Code: Select all

apollo_modelOutput(model, modelOutput_settings = list(printPVal=1)) # for one sided t-test
apollo_modelOutput(model, modelOutput_settings = list(printPVal=2)) # for two sided t-test
apollo_saveOutput(model, saveOutput_settings = list(printPVal=1)) # for one sided t-test
apollo_saveOutput(model, saveOutput_settings = list(printPVal=2)) # for two sided t-test
?apollo_modelOutput # for more details
Cheers
David
biancar
Posts: 5
Joined: 06 Sep 2021, 15:15

Re: Headers of Estimates.csv

Post by biancar »

Thank you so much! This was extremely helpful.
Bianca
biancar
Posts: 5
Joined: 06 Sep 2021, 15:15

Re: Headers of Estimates.csv

Post by biancar »

Hi David,

I tried out the p-value add on in my output, and while I got a robust t-ratio(0) of 1.8992, I also got a robust p-value (1-tailed) of 0.0575. Normally if looking at the 95% confidence level for a one-tailed test, the t-ratio would be significant if <1.645. But the p-value is contradicting that (since 0.0575 is greater than 0.05). I just wanted to confirm if this means that because it's a robust t-ratio using the robust "sandwich" covariance matrix, that the classical value of 1.645 to check the t-ratio's significance doesn't apply anymore?

Thanks!
Bianca
Attachments
Screenshot 2021-09-10 at 15.02.23.png
Screenshot 2021-09-10 at 15.02.23.png (33.93 KiB) Viewed 5962 times
biancar
Posts: 5
Joined: 06 Sep 2021, 15:15

Re: Headers of Estimates.csv

Post by biancar »

Hi David,

It might be my code, but I think something may be up with Apollo and the p-value output on the screen (in R) vs the saved files to the computer.

I inputted the following to print out 1-tailed p-values. The screen prints out one-tailed p-values. The version saved to the computer however definitely only prints out 2-tailed p-values. (I am using Apollo version 0.2.4).

Code: Select all

# ----------------------------------------------------------------- #
#---- FORMATTED OUTPUT (TO SCREEN)                               ----
# ----------------------------------------------------------------- #

apollo_modelOutput(model, modelOutput_settings = list(printPVal=1))

# ----------------------------------------------------------------- #
#---- FORMATTED OUTPUT (TO FILE, using model name)               ----
# ----------------------------------------------------------------- #

#apollo_saveOutput(model)

apollo_saveOutput(model,saveOutput_settings = list(printPVal=1))
dpalma
Posts: 190
Joined: 24 Apr 2020, 17:54

Re: Headers of Estimates.csv

Post by dpalma »

Hi Bianca,

I just looked at the code and you are right. The p-values written to the file ending in "_estimates.csv" are only those for the two-sided test, independent of the value of the "printPVal" setting.

The values printed to screen and written in the file ending in "_output.txt" should be correct, though.

Thank you for pointing this out. We will fix it in the next release (0.2.6), though we don't have a release date for it yet. For now, please use the p-values printed to screen or saved in the "_output.txt" file.

Cheers
David
Post Reply