{"action":"opened","issue":{"url":"https://api.github.com/repos/USGS-R/smwrQW/issues/7","labels_url":"https://api.github.com/repos/USGS-R/smwrQW/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/USGS-R/smwrQW/issues/7/comments","events_url":"https://api.github.com/repos/USGS-R/smwrQW/issues/7/events","html_url":"https://github.com/USGS-R/smwrQW/issues/7","id":104117617,"number":7,"title":"Possible issue with number of predictors and censReg","user":{"login":"scworland-usgs","id":11577981,"avatar_url":"https://avatars.githubusercontent.com/u/11577981?v=3","gravatar_id":"","url":"https://api.github.com/users/scworland-usgs","html_url":"https://github.com/scworland-usgs","followers_url":"https://api.github.com/users/scworland-usgs/followers","following_url":"https://api.github.com/users/scworland-usgs/following{/other_user}","gists_url":"https://api.github.com/users/scworland-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/scworland-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scworland-usgs/subscriptions","organizations_url":"https://api.github.com/users/scworland-usgs/orgs","repos_url":"https://api.github.com/users/scworland-usgs/repos","events_url":"https://api.github.com/users/scworland-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/scworland-usgs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-31T19:23:40Z","updated_at":"2015-08-31T19:23:40Z","closed_at":null,"body":"There seems to be a bug associated with the number of predictors used in censReg. I am not fully up-to-speed on censored regression, so I may be overlooking something obvious. In my example below, the function works fine for 30 observations and 10 predictors, but returns zeros for the fitted values when using 30 observations and 11 predictors. This is meant to be a general case, and the number of predictors at which this error occurs is not a hard threshold. I looked for a functional relationship between the observations and predictors, but I could not find one.\r\n\r\n```{r}\r\nset.seed(5)\r\nY1 <- runif(30, 1, 10)\r\n\r\n## 10 predictors\r\nX1 <- data.frame(replicate(10, Y1 + rnorm(30)))\r\n\r\n## 11 predictors\r\nX2 <- data.frame(replicate(11, Y1 + rnorm(30)))\r\n\r\n## make dataframes\r\nD1 <- cbind(Y1,X1)\r\nD2 <- cbind(Y1,X2)\r\n\r\n## censored regression\r\nfit.cens1 <- censReg(as.lcens(Y1, 5) ~ ., data=D1) \r\nfit.cens2 <- censReg(as.lcens(Y1, 5) ~ ., data=D2) \r\n\r\n## RMSE\r\nrmse(fit.cens1)\r\n[1] 0.5734079\r\n\r\nrmse(fit.cens2)\r\n[1] NA\r\n```"}}