Folks, I have a small dataset of counts of recoveries on defaulted loans:
recoveries<-structure(c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 0, 0, 0, 0, 0, 4, 0, 1, 2, 2, 12), .Dim = c(11L, 2L), .Dimnames = list( NULL, c("pcts", "counts"))) Here is the data in columnar form: pcts counts [1,] 0.0 0 [2,] 0.1 0 [3,] 0.2 0 [4,] 0.3 0 [5,] 0.4 0 [6,] 0.5 4 [7,] 0.6 0 [8,] 0.7 1 [9,] 0.8 2 [10,] 0.9 2 [11,] 1.0 12 For example row [6,] means that in our historical sample we saw 50% recoveries 4 times. Now I would like to "stress" the recovery distribution by say 67% so that the counts would stay the same but the bins (pcts) would contract like so: > recoveries*matrix(c(.67,1),nrow = 11, ncol = 2, byrow = TRUE) pcts counts [1,] 0.000 0 [2,] 0.067 0 [3,] 0.134 0 [4,] 0.201 0 [5,] 0.268 0 [6,] 0.335 4 [7,] 0.402 0 [8,] 0.469 1 [9,] 0.536 2 [10,] 0.603 2 [11,] 0.670 12 I would like to plot this using densityplot or an equivalent but on the original scale from 0.0 to 1.0. In addition I would like to either "integrate" the density plot or come up with a smooth version of the CDF after the 67% contraction. I hope this is clear, Thanks for your time, KW -- [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.