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.
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
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.
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.
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.
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=T
argument
Again, we can only speculate. Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With