Error in eval(predvars,data,env);object 'Banks' not found

I have been trying to fit a model using Banks as Y variable and 'Assets,profits, liabilities,taxes' as X variable but an error in eval occurs.
I don't understand what am doing wrong.Please help me.

to use BANKS as Y variable, use BANKS in place of where you wrote Y.
and please, when what you wish to share is textual information, then please copy and paste the text to share it rather than screenshotting it.
you can format text 'as code' by preceeding it with triple back-ticks

example of some code shared.

I wrote it as Banks first but still doesn't work

R is a case sensitive language therefore BANKS is different from Banks.

I have tried that and now it says;
Error in,y,offset=offset, singular.ok=singular.ok, ...) :
NA/NaN/Info in 'y'
In addition: warning message:
In storage.mode(v)<- "double" : NAs introduced by coercion.

joycsv <- read_csv("C:/Users/User/Desktop/joycsv.csv",

  •                col_types = cols(BANKS = col_character(),
  •                                 ASSETS = col_character(), PROFITS = col_character(),
  •                                 TAXES = col_character(), LIABILITIES = col_character(),
  •                                 EXPENSES = col_character()))

fit <- lm(BANKS~X1+X2+X3+X4+X5)
Error in eval(predvars, data, env) : object 'X1' not found
Error in eval(predvars, data, env) : object 'Y' not found
Error in, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'
In addition: Warning message:
In storage.mode(v) <- "double" : NAs introduced by coercion

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.