Normality Test Problem in RStudio

Hey,
When we check the normality of the data using shapiro test I got error massage as "Error in FUN(dd[x, ], ...) : all 'x' values are identical". When I checked my data set it contain with the 0 values for that variables. Do we unable to check the normality of that data in RStudio due to the identical values of variables. So how could I solve this problem. Please give me some guidance.

Thanks,

Hi and welcome!

I am not quite sure what you mean with that. Could you maybe post an example of your data? You can get some information on how to do this here.

Generally, shapiro.test() does indeed not work if all your samples have the same value. This makes sense since it tests for the distribution in the whole population, and if all the samples have the same value, the test does not really have the information it would need to test this.

So I'd recomend you to look into the way you obtained / generated your samples and try to understand why they all have the same value. Is it due to the way you are obtaining the data or was there maybe an error in handling them?

FeedType Aspartate
1 0.23356
1 0.25242
1 0.24299
2 0.00000
2 0.00000
2 0.00000
3 0.00000
3 0.00000
3 0.00000
4 0.14754
4 0.13922
4 0.14338
5 0.00000
5 0.00000
5 0.00000

This is the example for that

Hi ,

Your values in the group levels 2,3 and 5 are same and have not normal distribution, in addition, your sample sizes in group levels are so low (3 value in each group), so the results of normality tests will be unreliable. I think you should use nonparametric tests for comparison Asparate among FeedTypes.

1 Like

@Shahram Thank you for your suggestion I will try that

@jms I attached the sample of data. Could you please elaborate what is the reason and how could I do the normality test.

Are you testing individually for each feed type? In this case, you won't get any results for feed 2,3 and 5. Since all values in these feeds are equal, the Shapiro test basically does not have the information it needs to test the distribution.

@jms yp I test individually for each feed type. So do I need to use the non parametric test for analysis of this.