Speeglm $ operator is invalid for atomic vectors

283 views Asked by At

I am trying to execute the following code of a binary logit:

mylogit <- speedglm(dependent_variable ~ InterestRate, data = my_data, family = "binomial")

But I get the following error:

> mylogit <- speedglm(dependent_variable ~ InterestRate, data = my_data, family = "binomial")
Error: $ operator is invalid for atomic vectors

Here are the heads of the variables:

> head(my_data$dependent_variable)
[1] 0 1 1 1 1 1
> head(my_data$InterestRate)
[1] "0.165500" "0.165500" "0.165500" "0.165500" "0.165500" "0.165500"

Any ideas how to fix this?

EDIT:

Changing

family = "binomial"

to

family=binomial('logit')

seems to make it work

1

There are 1 answers

0
adrCoder On BEST ANSWER

EDIT:

Changing

family = "binomial"

to

family=binomial('logit')

seems to make it work