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. 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.

Signs of coefficients are complete opposite

Ask questions about how to estimate models and how to change your settings for estimation.
Post Reply
jbas
Posts: 10
Joined: 18 Feb 2021, 10:57

Signs of coefficients are complete opposite

Post by jbas »

Hello there,

I recently ran this SCE to collect information on individuals’ willingness to purchase MaaS bundles. Basically, each bundle includes free minutes of biclycle, electric scooter, taxi… at a price. And there are three bundles that offer more and more free minutes at a higher price. Prices are calculated on the total cost of each of those free services +/- a random %.

The point is that I’m obtaining in the model estimation signs for the coefficients completely contrary to what is expected. All LOS, which have a positive meaning (more free minutes), have a negative sign, while the price has a positive one, increasing the probability of choosing the alternative. Simply makes no sense.
I went over the data, and everything looks OK. LOS are much higher for the superior alternatives (basic, premium and superior) and choices look reasonable too (no dominant variable or alternative). I mean, I don’t think that the results show an actual preference for more expensive or less utility alternatives; I don’t see that in the data.

I wonder if I’m missing something in my model specification and it is wrong... (copied below). I can also add a snapshot of the data, if needed.

Thanks for your help.

J.

Code: Select all


# ################################################################# #
#### LOAD LIBRARY AND DEFINE CORE SETTINGS                       ####
# ################################################################# #

### Clear memory
rm(list = ls())

### Load Apollo library
library(apollo)
library(readxl)
#library(dplyr)

### Initialise code
apollo_initialise()

### Set core controls
apollo_control = list(
  modelName       = "MNL_v0",
  modelDescr      = "MNL generic LOS attributes",
  indivID         = "ID",
  outputDirectory = "output"
)

# ################################################################# #
#### LOAD DATA AND APPLY ANY TRANSFORMATIONS                     ####
# ################################################################# #

### Loading data and some treatment

raw_data <- read_excel("dfhghgfhfg/208001 UCM - MAAS ESCENARIOS PILOTO.xlsx")
database <- raw_data                

cols_to_convert <- c("taxi_B", "taxi_P", "taxi_S", "zitty_B", "zitty_P", "zitty_S", "moto_B", "moto_P", "moto_S", "patinete_B", "patinete_P", "patinete_S", "bici_B", "bici_P", "bici_S")
database[cols_to_convert] <- lapply(database[cols_to_convert], as.numeric)

numeric_columns <- sapply(database, is.numeric)
database[numeric_columns] <- scale(database[numeric_columns])

colnames(database)[colnames(database) == "ESCENARI"] <- "CHOICE"
database$av_basic <- 1
database$av_premium <- 1
database$av_superior <- 1
database$av_none <- 1

database$CHOICE <- as.numeric(factor(database$CHOICE, levels = c("BÁSICO", "PREMIUM", "SUPERIOR", "NINGUNO")))

hot_encoded <- model.matrix(~ NOTP - 1, database)
colnames(hot_encoded) <- c("D_estandar", "D_discap", "D_sin_carnet")
database <- cbind(database, hot_encoded)

### for data dictionary, use ?apollo_modeChoiceData

### Use only SP data EVERYTHING IS SP. USE THIS LATER FOR SUBGROUPS.
#database = subset(database,database$SP==1)

# ################################################################# #
#### DEFINE MODEL PARAMETERS                                     ####
# ################################################################# #

### Vector of parameters, including any that are kept fixed in estimation
apollo_beta=c(asc_basic      = 0,
              asc_prem      = 0,
              asc_sup      = 0,
              asc_none      = 0, # Quitar si se eliminan esas obs.
              # b_taxi_basic     = 0,
              # b_zitty_basic     = 0,
              # b_moto_basic     = 0,
              # b_patinete_basic    = 0,
              # b_bici_basic     = 0,
              # b_precio_basic       = 0,
              # b_taxi_prem     = 0,
              # b_zitty_prem     = 0,
              # b_moto_prem     = 0,
              # b_patinete_prem    = 0,
              # b_bici_prem     = 0,
              # b_precio_prem       = 0,
              # b_taxi_sup     = 0,
              # b_zitty_sup     = 0,
              # b_moto_sup     = 0,
              # b_patinete_sup    = 0,
              # b_bici_sup     = 0,
              # b_precio_sup       = 0,
              ###
              b_taxi     = 0,
              b_zitty     = 0,
              b_moto     = 0,
              b_patinete    = 0,
              b_bici     = 0,
              b_precio = 0
              
              ###
              #b_estandar = 0,
              #b_discap = 0,
              #b_sin_carnet = 0
              
              )

### Vector with names (in quotes) of parameters to be kept fixed at their starting value in apollo_beta, use apollo_beta_fixed = c() if none
apollo_fixed = c("asc_none")

# ################################################################# #
#### GROUP AND VALIDATE INPUTS                                   ####
# ################################################################# #

apollo_inputs = apollo_validateInputs()

# ################################################################# #
#### DEFINE MODEL AND LIKELIHOOD FUNCTION                        ####
# ################################################################# #

apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){
    
  ### Attach inputs and detach after function exit
  apollo_attach(apollo_beta, apollo_inputs)
  on.exit(apollo_detach(apollo_beta, apollo_inputs))

  ### Create list of probabilities P
  P = list()
  
  ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant
  V = list()
  V[["basic"]]  = asc_basic + b_precio * preu_B + 
      b_taxi * taxi_B + 
      b_zitty * zitty_B + 
      b_moto * moto_B + 
      b_patinete * patinete_B + 
      b_bici * bici_B
  
  V[["premium"]]  = asc_prem + b_precio * preu_P + 
      b_taxi * taxi_P + 
      b_zitty * zitty_P + 
      b_moto * moto_P + 
      b_patinete * patinete_P + 
      b_bici * bici_P
  
  V[["superior"]]  = asc_sup + b_precio  * preu_S + 
      b_taxi * taxi_S + 
      b_zitty * zitty_S + 
      b_moto * moto_S + 
      b_patinete * patinete_S + 
      b_bici * bici_S
  
  V[["none"]] = asc_none 
  
  ### Define settings for MNL model component
  mnl_settings = list(
    alternatives  = c(basic=1, premium=2, superior=3, none=4), 
    avail         = list(basic=av_basic, premium=av_premium, superior=av_superior, none=av_none), 
    choiceVar     = CHOICE,
    utilities     = V
  )
  
  ### Compute probabilities using MNL model
  P[["model"]] = apollo_mnl(mnl_settings, functionality)
  
  ### Take product across observation for same individual
  P = apollo_panelProd(P, apollo_inputs, functionality)
  
  ### Prepare and return outputs of function
  P = apollo_prepareProb(P, apollo_inputs, functionality)
  return(P)
}

# ################################################################# #
#### MODEL ESTIMATION                                            ####
# ################################################################# #

model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)

# ################################################################# #
#### MODEL OUTPUTS                                               ####
# ################################################################# #

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

apollo_modelOutput(model)

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

apollo_saveOutput(model)




Code: Select all

Model name                                  : MNL_v0
Model description                           : MNL generic LOS attributes
Model run at                                : 2024-09-23 16:57:44.334078
Estimation method                           : bgw
Model diagnosis                             : Relative function convergence
Optimisation diagnosis                      : Maximum found
     hessian properties                     : Negative definite
     maximum eigenvalue                     : -36.500448
     reciprocal of condition number         : 0.0778752
Number of individuals                       : 106
Number of rows in database                  : 636
Number of modelled outcomes                 : 636

Number of cores used                        :  1 
Model without mixing

LL(start)                                   : -881.68
LL at equal shares, LL(0)                   : -881.68
LL at observed shares, LL(C)                : -828.18
LL(final)                                   : -807.54
Rho-squared vs equal shares                  :  0.0841 
Adj.Rho-squared vs equal shares              :  0.0739 
Rho-squared vs observed shares               :  0.0249 
Adj.Rho-squared vs observed shares           :  0.0177 
AIC                                         :  1633.09 
BIC                                         :  1673.18 

Estimated parameters                        : 9
Time taken (hh:mm:ss)                       :  00:00:1.15 
     pre-estimation                         :  00:00:0.55 
     estimation                             :  00:00:0.17 
          initial estimation                :  00:00:0.13 
          estimation after rescaling        :  00:00:0.04 
     post-estimation                        :  00:00:0.44 
Iterations                                  :  7  
     initial estimation                     :  6 
     estimation after rescaling             :  1 

Unconstrained optimisation.

Estimates:
              Estimate        s.e.   t.rat.(0)    Rob.s.e. Rob.t.rat.(0)
asc_basic      0.51468     0.10090      5.1007     0.19524        2.6361
asc_prem      -0.34331     0.12314     -2.7881     0.22050       -1.5570
asc_sup       -0.56800     0.13215     -4.2982     0.24912       -2.2800
asc_none       0.00000          NA          NA          NA            NA
b_taxi        -0.07812     0.05610     -1.3926     0.05448       -1.4340
b_zitty       -0.02652     0.07311     -0.3628     0.10313       -0.2572
b_moto        -0.23779     0.06961     -3.4160     0.07833       -3.0357
b_patinete    -0.20992     0.06711     -3.1282     0.08019       -2.6178
b_bici        -0.17640     0.06331     -2.7860     0.06830       -2.5826
b_precio       0.07606     0.08718      0.8725     0.17609        0.4319

stephanehess
Site Admin
Posts: 1264
Joined: 24 Apr 2020, 16:29

Re: Signs of coefficients are complete opposite

Post by stephanehess »

Hi

what are the choice shares? And can you tabulate the choices against cost?

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
jbas
Posts: 10
Joined: 18 Feb 2021, 10:57

Re: Signs of coefficients are complete opposite

Post by jbas »

Thanks, Stephane, for your reply.

Let me copy below choice shares, and choice by cost. Regarding the latter, there is a high variety of prices since they have been calculated from each LOS combination (and then modified reducing increasing a certain %). I mean, I decided in advance a fixed cost of those services free minutes and just compute the total cost (of the kind 0.23cents per free minute of bike + 0.15cents per minute of scooter + ...); then apply a % of variation to break perfect multicol. So, the second matrix shows choice shares for each price level, segmented into quartiles.

Thanks a lot for the help.

BR,
J.

Code: Select all


     Choice     Share
 0   BASIC   0.419811
 1   NONE     0.253145
 2   PREMIUM  0.182390
 3   SUPERIOR  0.144654,

#####

CHOICE 		    BASIC   NONE       PREMIUM  SUPERIOR
 Price Basic
 (3.999, 51.77]    0.354037  0.322981  0.136646  0.186335
 (51.77, 68.09]    0.434783  0.260870  0.180124  0.124224
 (68.09, 77.562]   0.483871  0.212903  0.187097  0.116129
 (77.562, 133.52]  0.408805  0.213836  0.226415  0.150943,

CHOICE 		    BASIC   NONE       PREMIUM  SUPERIOR
 Price Premium
 (24.779, 77.428]  0.301887  0.345912  0.157233  0.194969
 (77.428, 93.26]   0.343558  0.233129  0.245399  0.177914
 (93.26, 104.48]   0.519231  0.224359  0.153846  0.102564
 (104.48, 159.28]  0.518987  0.208861  0.170886  0.101266,

CHOICE 		    BASIC   NONE       PREMIUM  SUPERIOR
 Price Superior
 (16.799, 102.96]  0.270115  0.264368  0.206897  0.258621
 (102.96, 112.31]  0.533333  0.246667  0.153333  0.066667
 (112.31, 123.46]  0.439490  0.254777  0.178344  0.127389
 (123.46, 165.86]  0.458065  0.245161  0.187097  0.109677)
stephanehess
Site Admin
Posts: 1264
Joined: 24 Apr 2020, 16:29

Re: Signs of coefficients are complete opposite

Post by stephanehess »

can you use the function apollo_choiceAnalysis with the price attributes as the covariates?
--------------------------------
Stephane Hess
www.stephanehess.me.uk
jbas
Posts: 10
Joined: 18 Feb 2021, 10:57

Re: Signs of coefficients are complete opposite

Post by jbas »

I'm trying to do so....

Code: Select all

choiceAnalysis_settings <- list(
    alternatives = c(basic=1, premium=2, superior=3, none=4),
    avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
    choiceVar = database$CHOICE,
    explanators = database[,c("preu_B","preu_P","preu_S")]#,
    #rows = (database$SP==1)
    )

apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
...but I get this error...

Error in apollo_validateData(database, apollo_control, silent = TRUE) :
INPUT ISSUE - All rows for the same individual should be next to each other in the data!


And the IDs of the same individual are indeed one after the other... See a few rows directly copied form the csv (six scenarios per individual).

Code: Select all

ID
190
190
190
190
190
190
191
191
191
191
191
191
194
194
194
194
194
194
195
195
195
195
195
195
196
196
196
196
196
stephanehess
Site Admin
Posts: 1264
Joined: 24 Apr 2020, 16:29

Re: Signs of coefficients are complete opposite

Post by stephanehess »

This could be related to the fact that you're loading the data via read_excel which creates a tibble which Apollo is not very compatible with. Try again with a csv file
--------------------------------
Stephane Hess
www.stephanehess.me.uk
jbas
Posts: 10
Joined: 18 Feb 2021, 10:57

Re: Signs of coefficients are complete opposite

Post by jbas »

Stephane, you were right, importing a csv solved it.

The result of applying

Code: Select all

choiceAnalysis_settings <- list(
    alternatives = c(basic=1, premium=2, superior=3, none=4),
    avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
    choiceVar = database$CHOICE,
    explanators = database[,c("preu_B","preu_P","preu_S")]
    )

apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
Is the following table (please notice that preu_B stands for the price of the alternative named BASIC, preu_S stands for the price of the alternative named PREMIUM (second best) and preu_S stands for the price of the alternative named SUPERIOR (best of all three):

Code: Select all

 basic
Explanator 1 (preu_B), mean when alt is chosen:                     65.7199
Explanator 1 (preu_B), mean when alt is not chosen:                 63.2480
Explanator 1 (preu_B), t-test (mean if chosen - mean if not chosen)  1.4900
                                                                    premium
Explanator 1 (preu_B), mean when alt is chosen:                     67.5409
Explanator 1 (preu_B), mean when alt is not chosen:                 63.5596
Explanator 1 (preu_B), t-test (mean if chosen - mean if not chosen)  2.0300
                                                                    superior
Explanator 1 (preu_B), mean when alt is chosen:                      62.5075
Explanator 1 (preu_B), mean when alt is not chosen:                  64.5865
Explanator 1 (preu_B), t-test (mean if chosen - mean if not chosen)  -0.9100
                                                                       none
Explanator 1 (preu_B), mean when alt is chosen:                     60.5782
Explanator 1 (preu_B), mean when alt is not chosen:                 65.5424
Explanator 1 (preu_B), t-test (mean if chosen - mean if not chosen) -2.1500

                                                                      basic
Explanator 2 (preu_P), mean when alt is chosen:                     94.7397
Explanator 2 (preu_P), mean when alt is not chosen:                 86.9137
Explanator 2 (preu_P), t-test (mean if chosen - mean if not chosen)  4.5700
                                                                    premium
Explanator 2 (preu_P), mean when alt is chosen:                     89.5041
Explanator 2 (preu_P), mean when alt is not chosen:                 90.3542
Explanator 2 (preu_P), t-test (mean if chosen - mean if not chosen) -0.4000
                                                                    superior
Explanator 2 (preu_P), mean when alt is chosen:                      83.1815
Explanator 2 (preu_P), mean when alt is not chosen:                  91.3859
Explanator 2 (preu_P), t-test (mean if chosen - mean if not chosen)  -3.1400
                                                                       none
Explanator 2 (preu_P), mean when alt is chosen:                     87.1799
Explanator 2 (preu_P), mean when alt is not chosen:                 91.2225
Explanator 2 (preu_P), t-test (mean if chosen - mean if not chosen) -1.9000

                                                                       basic
Explanator 3 (preu_S), mean when alt is chosen:                     113.1837
Explanator 3 (preu_S), mean when alt is not chosen:                 106.0650
Explanator 3 (preu_S), t-test (mean if chosen - mean if not chosen)   3.9700
                                                                     premium
Explanator 3 (preu_S), mean when alt is chosen:                     108.5950
Explanator 3 (preu_S), mean when alt is not chosen:                 109.1558
Explanator 3 (preu_S), t-test (mean if chosen - mean if not chosen)  -0.2100
                                                                    superior
Explanator 3 (preu_S), mean when alt is chosen:                      95.6041
Explanator 3 (preu_S), mean when alt is not chosen:                 111.3280
Explanator 3 (preu_S), t-test (mean if chosen - mean if not chosen)  -4.3400
                                                                        none
Explanator 3 (preu_S), mean when alt is chosen:                     110.2198
Explanator 3 (preu_S), mean when alt is not chosen:                 108.6582
Explanator 3 (preu_S), t-test (mean if chosen - mean if not chosen)   0.7800
stephanehess
Site Admin
Posts: 1264
Joined: 24 Apr 2020, 16:29

Re: Signs of coefficients are complete opposite

Post by stephanehess »

Hi

could you try the same with your other LOS variables. The ones for price look a bit concerning in places - you would expect that an alternative is chosen more often when the price is lower rather than the other way around

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
jbas
Posts: 10
Joined: 18 Feb 2021, 10:57

Re: Signs of coefficients are complete opposite

Post by jbas »

Stephane, sorry for the late reply. Sure, here are the shares by LOS.

If I'm reading the tables correctly, the mean value of the LOS were, almost in all cases, lower, when the chosen alternative was the Premium or Superior one. Which is precisely the opposite of what should be happening... This is saying that people chooses a transportation bundle when it is more expensive and they get less free minutes in all of those LOS. It doesn't make sense to me... Am I reading the analysis correctly?

If so, may it be due to the levels chosen for LOS in the design of the experiment?

Code: Select all

> #### Shares by free taxi minutes
> choiceAnalysis_settings <- list(
+     alternatives = c(basic=1, premium=2, superior=3, none=4),
+     avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
+     choiceVar = database$CHOICE,
+     explanators = database[,c("taxi_B","taxi_P","taxi_S")]#,
+     #rows = (database$SP==1)
+ )
> 
> apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
                                                                      basic premium superior    none
Explanator 1 (taxi_B), mean when alt is chosen:                     15.0562 16.2931  16.5217 15.0932
Explanator 1 (taxi_B), mean when alt is not chosen:                 15.8266 15.3269  15.3309 15.6421
Explanator 1 (taxi_B), t-test (mean if chosen - mean if not chosen) -0.8400  0.8200   0.9200 -0.5500

                                                                      basic premium superior    none
Explanator 2 (taxi_P), mean when alt is chosen:                     50.4494 49.2241  48.0435 50.3727
Explanator 2 (taxi_P), mean when alt is not chosen:                 49.4309 50.0000  50.1654 49.6842
Explanator 2 (taxi_P), t-test (mean if chosen - mean if not chosen)  0.8100 -0.4700  -1.1600  0.4900

                                                                      basic premium superior    none
Explanator 3 (taxi_S), mean when alt is chosen:                     78.9888 83.3621  79.7826 78.8820
Explanator 3 (taxi_S), mean when alt is not chosen:                 80.5149 79.0962  79.8897 80.2105
Explanator 3 (taxi_S), t-test (mean if chosen - mean if not chosen) -1.2200  2.7100  -0.0600 -0.9200

Ouputs of apollo_choiceAnalysis saved to output/MNL_v0_choiceAnalysis.csv
> 
> ####
> 
> #### Shares by free zitty minutes
> choiceAnalysis_settings <- list(
+     alternatives = c(basic=1, premium=2, superior=3, none=4),
+     avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
+     choiceVar = database$CHOICE,
+     explanators = database[,c("zitty_B","zitty_P","zitty_S")]#,
+     #rows = (database$SP==1)
+ )
> 
> apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
                                                                       basic premium superior    none
Explanator 1 (zitty_B), mean when alt is chosen:                     28.0899 26.2069  18.9130 29.3168
Explanator 1 (zitty_B), mean when alt is not chosen:                 25.7453 26.8462  28.0515 25.8526
Explanator 1 (zitty_B), t-test (mean if chosen - mean if not chosen)  1.2500 -0.2600  -3.6700  1.6300

                                                                       basic premium superior    none
Explanator 2 (zitty_P), mean when alt is chosen:                     56.2921 49.1379  41.9565 52.7329
Explanator 2 (zitty_P), mean when alt is not chosen:                 48.9160 52.6538  53.7132 51.7684
Explanator 2 (zitty_P), t-test (mean if chosen - mean if not chosen)  3.7800 -1.3400  -3.6500  0.4300

                                                                        basic premium superior    none
Explanator 3 (zitty_S), mean when alt is chosen:                     101.7228 90.8621  81.7391 96.5217
Explanator 3 (zitty_S), mean when alt is not chosen:                  91.0569 96.5769  97.8676 95.2000
Explanator 3 (zitty_S), t-test (mean if chosen - mean if not chosen)   3.2600 -1.2800  -2.7600  0.3500

Ouputs of apollo_choiceAnalysis saved to output/MNL_v0_choiceAnalysis.csv
> 
> ####
> 
> #### Shares by free motorbike minutes
> choiceAnalysis_settings <- list(
+     alternatives = c(basic=1, premium=2, superior=3, none=4),
+     avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
+     choiceVar = database$CHOICE,
+     explanators = database[,c("moto_B","moto_P","moto_S")]#,
+     #rows = (database$SP==1)
+ )
> 
> apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
                                                                      basic premium superior    none
Explanator 1 (moto_B), mean when alt is chosen:                     24.0449 27.9310  18.9130 28.0745
Explanator 1 (moto_B), mean when alt is not chosen:                 25.7453 24.3846  26.0662 24.0000
Explanator 1 (moto_B), t-test (mean if chosen - mean if not chosen) -0.9200  1.4300  -2.9000  1.9100

                                                                      basic premium superior    none
Explanator 2 (moto_P), mean when alt is chosen:                     97.6779 84.1379  75.4348 90.8075
Explanator 2 (moto_P), mean when alt is not chosen:                 84.8780 91.6154  92.7574 90.0632
Explanator 2 (moto_P), t-test (mean if chosen - mean if not chosen)  3.6800 -1.5900  -2.9600  0.1900

                                                                       basic  premium superior     none
Explanator 3 (moto_S), mean when alt is chosen:                     151.1610 136.5517 114.1304 141.4907
Explanator 3 (moto_S), mean when alt is not chosen:                 133.1165 141.6154 145.1838 140.4211
Explanator 3 (moto_S), t-test (mean if chosen - mean if not chosen)   3.8100  -0.7600  -3.8100   0.2000

Ouputs of apollo_choiceAnalysis saved to output/MNL_v0_choiceAnalysis.csv
> 
> ####
> 
> #### Shares by free scooter minutes
> choiceAnalysis_settings <- list(
+     alternatives = c(basic=1, premium=2, superior=3, none=4),
+     avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
+     choiceVar = database$CHOICE,
+     explanators = database[,c("patinete_B","patinete_P","patinete_S")]#,
+     #rows = (database$SP==1)
+ )
> 
> apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
                                                                          basic premium superior    none
Explanator 1 (patinete_B), mean when alt is chosen:                     27.7903 27.0690  24.5652 30.0621
Explanator 1 (patinete_B), mean when alt is not chosen:                 27.7507 27.9231  28.3088 26.9895
Explanator 1 (patinete_B), t-test (mean if chosen - mean if not chosen)  0.0200 -0.3500  -1.4300  1.4900

                                                                           basic premium superior     none
Explanator 2 (patinete_P), mean when alt is chosen:                     100.5618 93.2759  78.8043 105.3416
Explanator 2 (patinete_P), mean when alt is not chosen:                  94.9322 98.1923 100.4228  94.5684
Explanator 2 (patinete_P), t-test (mean if chosen - mean if not chosen)   2.0000 -1.2000  -4.1200   3.6400

                                                                           basic  premium superior     none
Explanator 3 (patinete_S), mean when alt is chosen:                     166.7416 155.0000 134.7826 170.9317
Explanator 3 (patinete_S), mean when alt is not chosen:                 156.9106 162.3846 165.4779 157.6842
Explanator 3 (patinete_S), t-test (mean if chosen - mean if not chosen)   3.1900  -1.5000  -4.0500   4.7600

Ouputs of apollo_choiceAnalysis saved to output/MNL_v0_choiceAnalysis.csv
> 
> ####
> 
> #### Shares by free bicycle minutes
> choiceAnalysis_settings <- list(
+     alternatives = c(basic=1, premium=2, superior=3, none=4),
+     avail = list(basic = database$av_basic, premium = database$av_premium, superior = database$av_superior, none = database$av_none),
+     choiceVar = database$CHOICE,
+     explanators = database[,c("bici_B","bici_P","bici_S")]#,
+     #rows = (database$SP==1)
+ )
> 
> apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)
                                                                      basic premium superior    none
Explanator 1 (bici_B), mean when alt is chosen:                     14.4569 14.3966  11.0870 14.5963
Explanator 1 (bici_B), mean when alt is not chosen:                 13.6585 13.9038  14.4853 13.7895
Explanator 1 (bici_B), t-test (mean if chosen - mean if not chosen)  0.9100  0.4100  -2.8200  0.7900

                                                                      basic premium superior    none
Explanator 2 (bici_P), mean when alt is chosen:                     45.5431 40.0000  35.9783 45.5901
Explanator 2 (bici_P), mean when alt is not chosen:                 41.4363 43.8654  44.3750 42.3368
Explanator 2 (bici_P), t-test (mean if chosen - mean if not chosen)  3.6100 -2.4100  -3.6600  2.8100

                                                                      basic premium superior    none
Explanator 3 (bici_S), mean when alt is chosen:                     80.7865 76.9828  64.7826 83.3540
Explanator 3 (bici_S), mean when alt is not chosen:                 76.7209 78.7500  80.7353 76.7579
Explanator 3 (bici_S), t-test (mean if chosen - mean if not chosen)  2.4200 -0.6800  -4.2400  4.0300
Last edited by jbas on 14 Oct 2024, 09:15, edited 1 time in total.
stephanehess
Site Admin
Posts: 1264
Joined: 24 Apr 2020, 16:29

Re: Signs of coefficients are complete opposite

Post by stephanehess »

Hi

sorry about the slow reply.

In your case, what you are seeing is that e.g. taxi_B is higher in those cases where it's not chosen than in those cases where it's chosen.

But the t-ratios are very low for the differences

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Post Reply