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 change the p_value of a t.test function

  amostra <- rnorm(27, mean = 1.1, 2.8)
  x <- t.test(amostra, mu = 0.3, alternative = "greater")

I have this code, but I am told that I need to test a H0: mu = 0.3 against H0: mu > 0.3, to the significance level of 0.04. I think they mean the p.value, but I have no idea how to change that

>Solution :

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

There is a conf.level argument, see ?t.test for more details. The default is conf.level = 0.95 which corresponds to alpha = 0.05 since confidence = 1 – alpha. So if you want significance level of 0.04 that corresponds to a conf.level = 0.96

x <- t.test(amostra, mu = 0.3, alternative = "greater",conf.level = 0.96)
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