# How to apply Shapiro test in R? [duplicate]

This question already has an answer here:

I'm pretty new to statistics and I need your help. I just installed the R software and I have no idea how to work with it. I have a small sample looking as follows:

Group A : 10, 12, 14, 19, 20, 23, 34, 41, 12, 13
Group B :  8, 12, 14, 15, 15, 16, 21, 36, 14, 19


I want to apply t-test but before that I would like to apply Shapiro test to know whether my sample comes from a population which has a normal distribution. I know there is a function shapiro.test() but how can I give my numbers as an input to this function?

Can I simply enter shapiro.test(10,12,14,19,20,23,34,41,12,13, 8,12, 14,15,15,16,21,36,14,19)?

## marked as duplicate by whuber♦Aug 10 '14 at 0:22

• 1) the Shapiro Wilk test doesn't tell you your data is normal; it sometimes tells you when it isn't. 2) Your data certainly won't be normal anyway (looks like they're positive integers for starters), so you're answering the wrong question with a test of normality. 3) The mixture distribution obtained from the combined samples are not assumed in the t-test to be normal, so even if it made sense to formally test the assumptions, you wouldn't test that. 4) Your R syntax is wrong, since shapiro.test takes a vector argument, and you're supplying a comma-separated collection of arguments. – Glen_b Aug 10 '14 at 2:07