Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in family$linkinv(eta) : Argument eta must be a nonempty numeric vector

The reason the title of the question is the error I am getting is because I simply do not know how to interpret it, no matter how much I research. Whenever I run a logistic regression with bigglm() (from the biglm package, designed to run regressions over large amounts of data), I get:

Error in family$linkinv(eta) : Argument eta must be a nonempty numeric vector

This is how my bigglm() function looks like:

fit <- bigglm(f, data = df, family=binomial(link="logit"), chunksize=100, maxit=10) 

Where f is the formula and df is the dataframe (of little over a million rows and about 210 variables).

So far I have tried changing my dependent variable to a numeric class but that didn't work. My dependent variable has no missing values.

Judging from the error message I wonder if this might have to do anything with the family argument in the bigglm() function. I have found numerous other websites with people asking about the same error and most of them are either unanswered, or for a completely different case.

like image 327
jgozal Avatar asked Jan 05 '16 18:01

jgozal


People also ask

What does argument ETA must be a nonempty numeric vector mean?

The error Argument eta must be a nonempty numeric vector to me looks like your data has either empty values or NA. So, please check your data. Whatever advice we provide here, cannot be tested until we see your code or the steps involved resulting an error. try this

What does Eval (family$initialize) error mean?

If your data or dependent variable is not a factor, you’ll get the eval (family$initialize) error. The error occurs when you are working with variables that are not factors. The reason is that factors are part of R’s data structure that represent categorical data.

What does error in eval(family$initialize) mean in R?

The error code that states error in eval (family$initialize) : y values must be 0 <= y <= 1 occurs in the R language when you’ve done something wrong on your dataset but the error code has no specifics as to what you’ve done wrong. Therefore, if you’ve run into this error, you are in the right place.

What is Matchit error in eval(family$initialize)?

Such an error message will read like a matchit error in eval (family$initialize) : y values must be 0 <= y <= 1. Part of the error code states y values must be 0 <= y <= 1, which means your response variable is not between zero and one.


1 Answers

The error Argument eta must be a nonempty numeric vector to me looks like your data has either empty values or NA. So, please check your data. Whatever advice we provide here, cannot be tested until we see your code or the steps involved resulting an error. try this

is.na(df) # if TRUE, then replace them with 0
df[is.na(df)] <- 0 # Not sure replacing NA with 0 will have effect on your model

or whatever line of the code is resulting in NAs generation pass na.rm=Targument

Again, we can only speculate. Hope it helps.

like image 199
user5249203 Avatar answered Nov 15 '22 05:11

user5249203