{"action":"opened","issue":{"url":"https://api.github.com/repos/chjackson/flexsurv-dev/issues/56","repository_url":"https://api.github.com/repos/chjackson/flexsurv-dev","labels_url":"https://api.github.com/repos/chjackson/flexsurv-dev/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/chjackson/flexsurv-dev/issues/56/comments","events_url":"https://api.github.com/repos/chjackson/flexsurv-dev/issues/56/events","html_url":"https://github.com/chjackson/flexsurv-dev/issues/56","id":361971227,"node_id":"MDU6SXNzdWUzNjE5NzEyMjc=","number":56,"title":"missing values in covariates","user":{"login":"topepo","id":5731043,"node_id":"MDQ6VXNlcjU3MzEwNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/5731043?v=4","gravatar_id":"","url":"https://api.github.com/users/topepo","html_url":"https://github.com/topepo","followers_url":"https://api.github.com/users/topepo/followers","following_url":"https://api.github.com/users/topepo/following{/other_user}","gists_url":"https://api.github.com/users/topepo/gists{/gist_id}","starred_url":"https://api.github.com/users/topepo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/topepo/subscriptions","organizations_url":"https://api.github.com/users/topepo/orgs","repos_url":"https://api.github.com/users/topepo/repos","events_url":"https://api.github.com/users/topepo/events{/privacy}","received_events_url":"https://api.github.com/users/topepo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-20T00:08:03Z","updated_at":"2018-09-20T00:08:03Z","closed_at":null,"author_association":"NONE","body":"[This line](https://github.com/chjackson/flexsurv-dev/blob/3ca61835db36fdc67171901f25bf74dec2fdf77f/R/flexsurvreg.R#L972) in `form.model.matrix` automatically drops any rows with missing data. \r\n\r\nIt would be nice to have the ability to get the same number of rows out of the `summary` function's predictions are were in `newdata` (otherwise you have to track down the missing rows and pad the predicted values). \r\n\r\nOne idea is to just use `na.pass` and let the predicted values have `NA`. Otherwise, having `na.action` as an option that gets passed along to `model.frame` would allow the user to make their own choice (but I would vote for `na.pass`). \r\n\r\n```r\r\n> library(sessioninfo)\r\n> library(flexsurv)\r\nLoading required package: survival\r\n> ovarian_miss <- ovarian\r\n> ovarian_miss$age[1] <- NA\r\n> \r\n> fitw <-\r\n+   flexsurvreg(formula = Surv(futime, fustat) ~ age,\r\n+               data = ovarian_miss[-(1:5), ],\r\n+               dist = \"weibull\")\r\n> predictions <- \r\n+   summary(fitw, newdata = ovarian_miss[1:5, \"age\", drop = FALSE], t = 1000)\r\n> \r\n> length(predictions)\r\n[1] 4\r\n> session_info()\r\n─ Session info ──────────────────────────────────────────────────────────────────────────────────\r\n setting  value                       \r\n version  R version 3.5.0 (2018-04-23)\r\n os       macOS High Sierra 10.13.6   \r\n system   x86_64, darwin15.6.0        \r\n ui       RStudio                     \r\n language (EN)                        \r\n collate  en_US.UTF-8                 \r\n tz       America/New_York            \r\n date     2018-09-19                  \r\n\r\n─ Packages ──────────────────────────────────────────────────────────────────────────────────────\r\n package      * version date       source         \r\n clisymbols     1.2.0   2017-05-21 CRAN (R 3.5.0) \r\n deSolve        1.21    2018-05-09 cran (@1.21)   \r\n flexsurv     * 1.1     2017-03-27 CRAN (R 3.5.0) \r\n lattice        0.20-35 2017-03-25 CRAN (R 3.5.0) \r\n Matrix         1.2-14  2018-04-09 CRAN (R 3.5.0) \r\n mstate         0.2.11  2018-04-09 CRAN (R 3.5.0) \r\n muhaz          1.2.6   2014-08-09 CRAN (R 3.5.0) \r\n mvtnorm        1.0-8   2018-05-31 cran (@1.0-8)  \r\n quadprog       1.5-5   2013-04-17 CRAN (R 3.5.0) \r\n RColorBrewer   1.1-2   2014-12-07 CRAN (R 3.5.0) \r\n Rcpp           0.12.18 2018-07-23 cran (@0.12.18)\r\n sessioninfo  * 1.0.0   2017-06-21 CRAN (R 3.5.0) \r\n survival     * 2.42-3  2018-04-16 CRAN (R 3.5.0) \r\n withr          2.1.2   2018-03-15 CRAN (R 3.5.0) \r\n yaml           2.2.0   2018-07-25 cran (@2.2.0)  \r\n```\r\n"}}
{"actor":{"display_login":"topepo"}}