Hello R-users
The help I received from Petr helped me created this solution to my problems.
t1-with(mydata ,aggregate(mydata$Y,
list(mydata$time,mydata$treatment, mydata$expREP, mydata$techREP) ,
median, na.rm=T)) ### find median by factors
colnames(t1)-c(time,treatment,expREP,techREP,Y50)
Hello R-users
The help I received from Petr helped me created this solution to my problems.
t1-with(mydata ,aggregate(mydata$Y,
list(mydata$time,mydata$treatment, mydata$expREP, mydata$techREP) ,
median, na.rm=T)) ### find median by factors
Hello R users,
Problem...I do not understand how to use aggregate,by, or the
appropriate apply to perform a function on data with more than one
factor on unbalanced data...
I have a data frame in the long format that does not contain balanced
data. The ID is a unique identifier corresponding
Here is one way of doing it:
# create the rows for each unique combination
x.split - split(seq(nrow(mydata)), list(mydata$time, mydata$treatment,
+ mydata$expREP, mydata$techREP), drop=TRUE)
# now go through the list of indices and add the median
mydata$Y50 - 0 # add the dummy median
Hi
you can use aggregate to create table of medians
with(mydata, aggregate(Y, list(time, tratment, expRep,), median)
repeats of unique factors
either by rle or aggregate with length function
Then you can do replication by
norep - rep(your.median, each = your replicates)
Regards
Petr
On