Question

 c<- c(1.88, 2.33, -2.4, -0.6)
 dim(c)<-c(2,2)

I have a data set, 9X12 matrix. The data set is standardized to be normal, so I can compare each element.

For better comparing, I want to change each value to p-value.

How can I make it? (Please use above matrix.)

Please let me know.

Était-ce utile?

La solution

Don't use c for a variable name (you know better):

A <- c(1.88, 2.33, -2.4, -0.6)
dim(A) <- c(2,2)

You are looking for pnorm:

pnorm(A)
#           [,1]        [,2]
# [1,] 0.9699460 0.008197536
# [2,] 0.9900969 0.274253118
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top