3-cs-fraudulent-transactions

9119 5ba51012212ca d5342520e202520 0

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: amp;%8,10$ IQR > library(plyr) > prodprice <- ddply(sales, "Prod", summarize, + median = median(Uprice, na.rm=T), + IQR = quantile(Uprice, probs=.75, na.rm=T) + quantile(Uprice, probs=.25, na.rm=T)) > head(prodprice) Prod median IQR 1 p1 11.428571 10.399273 1e+03 2 p2 10.877863 5.609731 3 p3 10.000000 5.731709 4 p4 9.911243 5.998530 1e+01 5 p5 11.000000 8.297941 6 p6 13.270677 6.969951 > qplot(median, IQR, data=prodprice, alpha=I(0.2)) + scale_x_log10() + scale_y_log10() 1e-01 1e-01 Statistics 503, Spring 2013, ISU 1e+01 median 1e+03 What’s this? 13 >.1&%8,10$ > sales$Prod <- factor(sales$Prod, levels=prodprice$Prod[ order(prodprice$median, decreasing=T)]) > qplot(Prod, Uprice, data=sales, alpha=I(0.2)) + scale_y_log10() + coord_flip() O55%)#">AB*2 [0(55+2*%A.1*% )#1B+%)#">AB*%(.>% 5(#$+2* Uprice 1e+03 1e+01 1e-01 p3689 Prod p560 Statistics 503, Spring 2013, ISU 14 >.1&%8,10$ > sales$Prod <- factor(sales$Prod, levels=prodprice$Prod[ order(prodprice$median, decreasing=T)]) > qplot(Prod, Uprice, data=sales, alpha=I(0.2)) + scale_y_log10() + coord_flip() O55%)#">AB*2 [0(55+2*%A.1*% )#1B+%)#">AB*%(.>% 5(#$+2* Uprice 1e+03 1e+01 1e-01 p3689 Prod p560 Statistics 503, Spring 2013, ISU 14 678-2,1.9%?1##1.9# &(5BA5(*+%)#")"#*1".%"/%01221.$2%".%CA(.*%\% D(5%34%2(5+20+.%E%<"%2"0+%2(5+20+.%#+)"#*% 0"#+%)""#54%*'(.%"*'+#2] [(0+%($(1.%/"#%)#">AB*2%E%O#+%2"0+% )#">AB*2%#+)"#*+>%0"#+%)""#54%*'(.%"*'+#2]% Statistics 503, Spring 2013, ISU 15 678-2,1.9%?1##1.9# > totS <- table(sales$ID) > nas <- sales[which(is.na(sales$Quant) & is.na(sales$Val)), c('ID','Prod')] > propS <- 100*table(nas$ID)/totS > propS[order(propS,decreasing=T)[1:10]] v1237 13.793103 v4170 5.555556 v4254 9.523810 v4926 5.555556 v4038 8.333333 v4664 5.494505 v5248 8.333333 v4642 4.761...
View Full Document

Ask a homework question - tutors are online