Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to refer to a variable in the Shapiro test?

I would like to ask you about shapiro test in R. How can I refer to a variable in test result?

r<-shapiro.test(reszty)
r

    Shapiro-Wilk normality test

data:  reszty
W = 0.9226, p-value = 4.967e-07

I would like to refer to w and to p-value.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In general, for function calls in R you can extract information after assigning to a variable doing this:

r<-shapiro.test(reszty)
r$statistic (for W) or r$p.value (for p-val)

or you can not assign to a variable, but extract straight away:

shapiro.test(reszty)$p.value
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading