Shapiro Test Error

Hi All. This is my first post :slight_smile:

I want to check for the normality of my data using a Shapiro-Wilk test. It worked fine for all the other variables I have looked at, but suddenly it says "sample size must be between 3 and 5000". I am definitely in this range (n=21).

I have a column of data with 2 land management strategies (text), and a column containing a protein value (numbers). I want to see whether each management type's protein values are normally distributed. Below is the code. I would really appreciate your help with this!

Thanks

Daniel

#csv file name "Mean_Protein

attach(Mean_Protein)
RP.vnp <- Mean_Protein$Management == "VNP" #first management system
RP.konv <- Mean_Protein$Management == "KONV" #second management system

#for the konv management system:
shapiro.test(Mean_Protein$Protein_rel_TM_g_kg[RP.konv])
attach(Mean_Protein)
RP.vnp <- Mean_Protein$Management == "VNP"
RP.konv <- Mean_Protein$Management == "KONV"

shapiro.test(Mean_Protein$Protein_rel_TM_g_kg[RP.konv])

Hi!

Since this is most likely related to your specific data, to help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

image

Management Systems are either "KONV" or "VNP"

The values are under "Protein_rel_TM_g_kg"

In the CSV file itself, Management is simply showing as "Management", not "I...Management" as in R Studio. I don't know why but perhaps that plays a role here too?

This is the raw data

Management Protein_rel_TM_g_kg
KONV 154.3308943
KONV 149.1710395
KONV 138.6193821
KONV 137.1424695
KONV 148.7541504
VNP 134.9632877
VNP 95.34660831
VNP 138.8368989
VNP 149.2707739
VNP 123.6545293
VNP 120.6370481
VNP 120.9075132
VNP 119.3779466
VNP 113.2173484
VNP 106.849136
VNP 122.6948868

The information you have provided does not reproduce your issue, please read the guide I linked for you and try to make a proper reproducible example.

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.