5
$\begingroup$

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!

$\endgroup$
1
  • $\begingroup$ See my updated answer. If you find it useful please consider upvoting and/or accepting it. $\endgroup$
    – utobi
    Commented Nov 2, 2022 at 19:40

1 Answer 1

4
$\begingroup$

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))
$\endgroup$
8
  • $\begingroup$ 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? $\endgroup$
    – Jean
    Commented Nov 2, 2022 at 14:19
  • $\begingroup$ what are you using this test for? this test is mostly useful prior to running the ANOVA test... $\endgroup$
    – utobi
    Commented Nov 2, 2022 at 14:20
  • $\begingroup$ 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. $\endgroup$
    – Jean
    Commented Nov 2, 2022 at 14:33
  • 1
    $\begingroup$ the latter (audpc v shoot.len) $\endgroup$
    – Jean
    Commented Nov 2, 2022 at 16:04
  • 1
    $\begingroup$ then replace the tilde by , $\endgroup$
    – utobi
    Commented Nov 2, 2022 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.