error runing a function lm

Hi,
I´m trying to run this function:
z<-lm(mrall~beertax+mlda+jaild+vmiles+unrate+perinc, data=essay).
I don´t know why this keeps appearing:
Error in lm.fit(x, 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

I have the following dataframe:
str(dataset)
'data.frame': 336 obs. of 11 variables:
stato : int 1 2 3 4 5 6 7 8 9 10 ... state : int 1 1 1 1 1 1 1 4 4 4 ...
year : int 1982 1983 1984 1985 1986 1987 1988 1982 1983 1984 ... mrall : chr "2,12836006539874" "2,34848004765809" "2,33643004321493" "2,19348003156483" ...
beertax: chr "1,53937947750092" "1,78899073600769" "1,71428561210632" "1,65254235267639" ... mlda : chr "19" "19" "19" "19,6700000762939" ...
jaild : chr "no" "no" "no" "no" ... comserd: chr "no" "no" "no" "no" ...
vmiles : chr "7,23388720703125" "7,83634765625" "8,262990234375" "8,7269169921875" ... unrate : chr "14,3999996185303" "13,6999998092651" "11,1000003814697" "8,89999961853027" ...
$ perinc : chr "10544,15234375" "10732,7978515625" "11108,791015625" "11332,626953125" ...

Can someone help me?
Thankyou!

Looks like many of your variables are characters that should be converted to numeric before running the regression.

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.