cran / bife

:exclamation: This is a read-only mirror of the CRAN R package repository. bife — Binary Choice Models with Fixed Effects. Homepage: https://github.com/amrei-stammann/bife Report bugs for this package: https://github.com/amrei-stammann/bife/issues
1 stars 3 forks source link

Predict #2

Open BrianAronson opened 4 years ago

BrianAronson commented 4 years ago

Hi,

This is a fantastic package. I just wanted to note that the predict function does not work as intended. It does not seem possible to make predictions for new data. For example, the following code returns the error 'X_new of wrong dimension':

library(bife)
dataset <- psid
mod <- bife(LFP ~ I(AGE^2) + log(INCH) + KID1 + KID2 + KID3 + factor(TIME) | ID, dataset)
pred.data <- dataset[1:10, ]
predict(mod, X_new = pred.data)

I found a workaround by altering the data within the bife model itself, for example:

library(bife)
dataset <- psid
mod <- bife(LFP ~ I(AGE^2) + log(INCH) + KID1 + KID2 + KID3 + factor(TIME) | ID, dataset)
mod$data<- mod$data[1:10, ]
predict(mod)

However, maybe this workaround could be coded into the current predict.bife function?

Best,

Brian

gaborcsardi commented 4 years ago

Hi, this is a read only mirror of CRAN, please see the package authors in the DESCRIPTION file. Thanks!