Displaying 1 result from an estimated 1 matches for "meanabsolute".
2012 Feb 07
2
Weighted mad
Greetings UseRs,
Pls advise if there is a way to write a func that can be supplied to aggregate to compute weighted MeanAbsolute Dev (MAD). I am having trouble passing the correct weights from each group level and cannot see the code behind aggregate. But maybe 'aggregate' is not the best way to do that.
> m1 <- aggregate(pool[,c("SMM")],by=list(time=pool$ym),weighted.mean,w=pool$wght)
Error in weigh...