Performing ANOVA with NA values

Hey! I am trying to perform a two-way ANOVA from a dataset which contains NA values in the factor used for the comparison. I used na.omit to remove the lines containing NA values, but I still get the following error:

NA, NaN and Inf can all cause computations to fail, but for different reasons, some of which involve operations on data that don't contain NA at all

0 + 0 # OK
#> [1] 0
0 - 0 # OK
#> [1] 0
0 * 0 # OK
#> [1] 0
0 / 0 # Not a number
#> [1] NaN
mean(c(1,NA)) # NA
#> [1] NA
1 + NA # NA, missingness
#> [1] NA
1/0   # Infinity
#> [1] Inf
1 + NULL # nothingness
#> numeric(0)

Created on 2023-03-20 with reprex v2.0.2

Thanks for your answers. I have had no issues with this dataset before and have performed other analyses; is there any way for me to find out what is causing the issue and bypass it?

There may be, but it will be hard to find help here without a reprex. See the FAQ without representative data that behaves as the data you are using.

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.