[R] saving only part of a computation in integrate
Erik Iverson
eiverson at NMDP.ORG
Thu Jul 30 19:03:33 CEST 2009
See ?str
> str(Beta)
List of 5
$ value : num 0.99
$ abs.error : num 4.22e-06
$ subdivisions: int 4
$ message : chr "OK"
$ call : language integrate(f = dnorm, lower = -Inf, upper = 2.3552, mean = 0, sd = 1)
- attr(*, "class")= chr "integrate"
> Beta$value
[1] 0.9907436
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Mary A. Marion
Sent: Thursday, July 30, 2009 2:56 PM
To: r-help at r-project.org
Subject: [R] saving only part of a computation in integrate
Hello,
I am using
Beta <-integrate(dnorm,mean=0,sd=1,-Inf,2.3552)
> Beta
0.9907436 with absolute error < 4.2e-06
1-Beta results in an error
How can I store into Beta only .9907436?
Thank you.
Sincerely,
Mary A. Marion
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list