Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlogit example produces an error #38

Open
sam-crawley opened this issue Jun 25, 2019 · 2 comments
Open

mlogit example produces an error #38

sam-crawley opened this issue Jun 25, 2019 · 2 comments
Labels

Comments

@sam-crawley
Copy link

@sam-crawley sam-crawley commented Jun 25, 2019

The example for mlogit from the documentation does not work for me:

library("prediction")
library(mlogit)

data("Fishing", package = "mlogit")
Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice = "mode")
mod <- mlogit(mode ~ price + catch, data = Fish)
prediction(mod)

Produces: Error in tmp[["fit"]] : subscript out of bounds

traceback:

4: data.frame(..., check.rows = FALSE, check.names = FALSE, fix.empty.names = FALSE, 
       stringsAsFactors = FALSE)
3: make_data_frame(data, fitted = tmp[["fit"]], se.fitted = tmp[["se.fit"]])
2: prediction.default(mod)
1: prediction(mod)

sessionInfo:

R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

locale:
 [1] LC_CTYPE=en_NZ.UTF-8       LC_NUMERIC=C               LC_TIME=en_NZ.UTF-8        LC_COLLATE=en_NZ.UTF-8     LC_MONETARY=en_NZ.UTF-8   
 [6] LC_MESSAGES=en_NZ.UTF-8    LC_PAPER=en_NZ.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] mlogit_0.4-2      lmtest_0.9-37     zoo_1.8-6         Formula_1.2-3     prediction_0.3.14

loaded via a namespace (and not attached):
 [1] lattice_0.20-38   MASS_7.3-51.4     grid_3.6.0        magrittr_1.5      bibtex_0.4.2      Rdpack_0.11-0     stringi_1.4.3     data.table_1.12.2
 [9] statmod_1.4.32    tools_3.6.0       stringr_1.4.0     yaml_2.2.0        compiler_3.6.0    gbRd_0.4-11 
@leeper leeper added the bug label Jun 26, 2019
@leeper

This comment has been minimized.

Copy link
Owner

@leeper leeper commented Jun 26, 2019

Thanks - I'll investigate.

@leeper leeper added question and removed bug labels Dec 24, 2019
@leeper

This comment has been minimized.

Copy link
Owner

@leeper leeper commented Dec 24, 2019

Hmm. Unfortunately, I'm not able to reproduce this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.