Error message when using "car" package

I keep getting error messages whenever I download "car" package to perform a levene test
#Open data file

data(mtcars)
#Check for equal variances
library(car)
leveneTest(mtcars$qsec_before~as.factor(mtcars$am))
Error in model.frame.default(form) :
invalid type (NULL) for variable 'mtcars$qsec_before'

The mtcars data set doesn't contain a variable called qsec_before and you are not defining it anywhere in your code, that is why you get the NULL error, you should check on that.

names(mtcars)
 [1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"   "gear" "carb"

Thanks for your quick reply. I am a newbie at this, I am trying to test the distribution of automatic and manual transmission. qsec represents the quater mile time of various cars

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.