user3483493
user3483493

Reputation: 1

extreme bounds package in R

I am new in R and I need to learn to use the Package ‘ExtremeBounds’. I am using the tutorial mtcars dataset to learn and as I am doing different exercises I continuously get this error

Error in reg.summary$coefficients[variable.label, 1] : 
  subscript out of bounds

If i do

eba(data = mtcars[1:32,], y = "mpg", free = "wt", doubtful = c("cyl","disp","hp","drat","qsec","vs","am","gear","carb"), focus = c("hp","gear"), k = 0:3, mu = 0, leve = 0.85) 

I don't get the error, but when I try to do the following, i get the error

eba(data = mtcars[1:8,], y = "mpg", free = "wt", doubtful = c("cyl","disp","hp","drat","qsec","vs","am","gear","carb"), focus = c("hp","gear"), k = 0:3, mu = 0, leve = 0.85) 

Can someone tell me what I am doing wrong? I would really appreciate it as I need to use this package for a school project.

Thank you

Upvotes: 0

Views: 153

Answers (1)

user3477397
user3477397

Reputation: 143

This is a collinearity problem. When you use only the first 8 data points cyl and vs exactly determine the value of gears, which causes an internal error in the function code. There is no way of getting around this issue. You either have to use more data or you cannot have gears as a focus variable. Alternatively, you could remove either cyl or vs from the doubtful variables and the function will work then as well.

Upvotes: 2

Related Questions