Displaying 1 result from an estimated 1 matches for "asdc".
Did you mean:
asc
2007 Feb 15
1
Function to assign quantiles?
...if dvals[322] = 256, I want to assign qvals[322] = 3, and if
dvals[7216] = 1083, I want qvals[7216] = 7, etc. I would think there would
be a function, or some very quick code to do that, but I couldn't find it.
Here's what I have now. It works, but I figure there must be a better way:
asdc <- function(q){max(1,which(qvec<q))}
qvals = apply(matrix(dvals,nrow=1),2,asdc)
Any suggestions? Thanks!
-- TMK --
212-460-5430 home
917-656-5351 cell