2011-06-07 12 views
19

Olası Çoğalt:
R, correlation: is there a func that converts a vector of nums to a vector of standard unitsZ-skorunu R ile hesaplayabilir miyim?

StackOverflow'daki adlı okuyarak, belki Python veya Perl ile hesaplanan z-skoru buldum ama henüz Ar herhangi rastlar yaptı. Onu özledim mi? R ile yapılması mümkün mü?

olarak (http://en.wikipedia.org/wiki/Standard_score.)

Bunun için tasarlanan R paketleri olduğuna inanıyorum
z-score = (x-μ)/σ 

x is a raw score to be standardized; 
μ is the mean of the population; 
σ is the standard deviation of the population. 

? Onları nerede bulabiliriz? Veya normalleştirme için benzer bir paket?

+1

çoğaltır: http://stackoverflow.com/questions/6148050/creating-z-scores http://stackoverflow.com/questions/5835545/r-correlation-is-there- a-func-dönüştüren-a-vektör-of-a-vektör-of-sta/5835599 # 5835599 –

+3

Simon Blomberg: Bu, R. Sadece nasıl. - 'falcı (“ simon blomberg ”)' –

+0

neden pnorm (x, μ, σ) 'bir çözüm değil? –

cevap

42

x, ham puanlı bir vektör ise scale(x) standartlaştırılmış puanlara sahip bir vektördür.

Ya elle: (x-mean(x))/sd(x)