I have a question about R.
I am using a test called levene.test to test a homogeneity of variance.
I know that you need a factor variable with at least two l
You need to actually convert your variable to a factor. Just having three (or a finite) number of values does not necessarily make it a factor.
use x <- factor(x) to convert
When you look at the output of str(), it shows you the type of each variable:
<..cropped..>
$ SIF1 : num 19.6 17 NA 23.8 24.1 ...
$ sex : Factor w/ 2 levels "0","1": 1 1 2 2 2 2 1 1 1 1 ...
$ k : Factor w/ 3 levels "0","1","2": 1 1 2 3 1 3 3 3 1 2 ...
notice that $k is a factor but SIF1 is not
Thus, use
geno1rs11809462$SIF1 <- factor(geno1rs11809462$SIF1)