Roslina,
this code performs what you need:
dt = matrix((1:(58*12))/58/12,58) # some numbers
# if dt is a data.frame use dt = as.matrix(dt)
a = (1:12)/12 # some a coef
b = (12:1)/12 # some b coef
dtgam = matrix(pgamma(dt,a,b),58)
# dtgam is the transformation you're looking for
Hi R-users,
I have this code to uniformise the data using gamma:
> length(dp1)
[1] 696
> dim(dp1)
[1] 58 12
> dim(ahall)
[1] 1 12
> dim(bhall)
[1] 1 12
> trans_dt <- function(dt,a,b)
+ { n1 <- ncol(dt)
+ n2 <- length(dt)
+ trans <- vector(mode='numeric', length=n2)
+ dim(trans) <- dim
2 matches
Mail list logo