# Fligner-Killeen test: p-value of NA in R

I have not been able to find an answer to this question. I have multiple continuous variables and I am trying to run a multiple linear regression. As part of that, I am checking the assumption of homogenity of variance using a Fligner-Killeen test in R. The issue is that I keep getting a p-value of NA.

Here is my code: fligner.test(data3$AUDPC~data3$Shoot.len)

Here is the output: Fligner-Killeen test of homogeneity of variances

data: AUDPC by Shoot.len Fligner-Killeen:med chi-squared = NaN, df = 16, p-value = NA=

Based on the limited search results it seems like this happens when the variance is 0, expect this definitely is not the case in my dataset. Here is the list of values for shoot length:

7, 16.5, 23, 14.5, 22.4, 21.2, 30.8, 25.5, 34.8, 28.1, 27.5, 26, 30.4, 26.3, 24.2, 30.3, 25.5

I know the AUDPC values are not the problem because the test worked with one of my other variables (but I have this issue for the other 16 variables in my dataset).

I have no zeros or NA values in my dataset.

I am having the same issue when I try to use the Levene Test.

Sorry if this is confusing/poorly formatted, this is my first time asking a question. Thank you!

• See my updated answer. If you find it useful please consider upvoting and/or accepting it. Commented Nov 2, 2022 at 19:40

The Fligner-Killeen tests evaluate the null hypothesis that the groups have equal variances.

Quoting from the help page (i.e. ?fligner.test)

fligner.test(x, ...)

## Default S3 method:
fligner.test(x, g, ...)

## S3 method for class 'formula'
fligner.test(formula, data, subset, na.action, ...)

Arguments
x  a numeric vector of data values, or a list of numeric data vectors.
g  a vector or factor object giving the group for the corresponding elements of x. Ignored if x is a list.
formula  a formula of the form lhs ~ rhs where lhs gives the data values and rhs the corresponding groups.
data an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).
...


Thus, in the form

fligner.test(y~group)


you are testing for the homogeneity of variance of y across the groups defined by the factor group.

Alternatively, in the case of two continuous variables y1 and y2, you can invoke

fligner.test(y1,y2)


Your example is not running because Shoot.len is a continuous variable. Thus the correct command is

fligner.test(data3$$AUDPC, data3$$Shoot.len)


In this approach, if you want to test for the homogeneity of variances for more than two variables you'll have to provide everything inside a list. For instance, in the case of four variables, you may use

fligner.test(list(y1,y2,y3,y4))
`
• So because both of my variables are continuous, I cannot use the fligner test? What would an alternative test be in which I can use two continuous variables?
– Jean
Commented Nov 2, 2022 at 14:19
• what are you using this test for? this test is mostly useful prior to running the ANOVA test... Commented Nov 2, 2022 at 14:20
• I am running a multiple linear regression, but I need to check the assumption of homogeneity of variance. I have used this in the past when doing regressions with no issues, so I don't understand why I am having an issue now.
– Jean
Commented Nov 2, 2022 at 14:33
• the latter (audpc v shoot.len)
– Jean
Commented Nov 2, 2022 at 16:04
• then replace the tilde by , Commented Nov 2, 2022 at 16:16