![](/img/trans.png)
[英]Given an x and polynomial equation, is there way to get the y value using r?
[英]R - Get X value for given Y value
我有一個標准正態分布的累積分布函數,我有一個給定的y值,應該是0.95
dist <- function(x) pnorm(x,0,1)
如何求解0.95 = dist(x)
的等式0.95 = dist(x)
?
您可以使用uniroot功能,如下所示:
dist <- function(x) pnorm(x,0,1) - 0.95
uniroot(dist, interval = c(-1,4))
這將給你與qnorm(0.95,0,1)相同的答案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.