0

I don't understand why the pnorm lower.tail = F and lower.tail = T give me the same value:

> val
[1] 5100000
> mean
[1] 5e+06
> sd
[1] 40000
> pnorm(val,mean,sd,lower.tail=F)
[1] 0.9937903
> pnorm(val,mean,sd,lower.tail = T)
[1] 0.9937903
> 1 - pnorm(val,mean,sd,lower.tail=F)
[1] 0.006209665
> 

I would expect the 1 - pnorm(val,mean,sd,lower.tail=F) to be the same as lower.tail = T. And why does lower.tail = T and lower.tail = F return the same value... Probably I'm just missing something

UPDATE I just restarted R studio and the problem seems to be solved now. But the most interesting is what could have caused this?

  • what is your value of `F`? I can reproduce it when I do `F <- TRUE; pnorm(val, mean, sd, lower.tail = F)`. What do you get when using `lower.tail = FALSE`? – Benjamin Oct 25 '16 at 15:39
  • 1
    `pnorm(val,mean,sd,lower.tail=F)` gives `0.006209665` – ExperimenteR Oct 25 '16 at 15:39
  • So there should have been a variabele (F or T) which I have gave a value? – Bioinformatician Oct 25 '16 at 15:45
  • 1
    Yes. And I'm guessing it was `F` that had the value assigned. This is the reason I never use `F` or `T` as logical values. I recommend always using the full `FALSE` and `TRUE`. – Benjamin Oct 25 '16 at 15:47
  • thankyou great advise hahah can you answer this question so I can check it as a good answer maybe this will help out some people @Benjamin – Bioinformatician Oct 25 '16 at 15:55

0 Answers0