Skip to content

null predictor space: "Error in zzs$coefficients[u, 1] : subscript out of bounds" #149

@adw96

Description

@adw96

The cryptic error message Error in zzs$coefficients[u, 1] : subscript out of bounds arises when the single predictor variable is all zeroes. (This sounds trivial that may happen in automated large scale data analysis.)

### ideal behaviour
lm(rnorm(10) ~ rep(0, 10))
glm(rpois(10, 10) ~ rep(0, 10), family="poisson")
rigr::regress("rate",
              formula = rpois(10, 10) ~ rep(0, 10) + rnorm(10),
              data=df)
rigr::regress("mean",
              formula = rpois(10, 10) ~ rep(0, 10) + rnorm(10),
              data=df)

### error with unhelpful error message
rigr::regress("rate",
              formula = rpois(10, 10) ~ rep(0, 10),
              data=df)
rigr::regress("mean",
              formula = rpois(10, 10) ~ rep(0, 10),
              data=df)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions