3-cs-fraudulent-transactions

# 9119 5ba51012212ca d5342520e202520 0

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: amp;%8,10\$ IQR &gt; library(plyr) &gt; prodprice &lt;- ddply(sales, &quot;Prod&quot;, summarize, + median = median(Uprice, na.rm=T), + IQR = quantile(Uprice, probs=.75, na.rm=T) + quantile(Uprice, probs=.25, na.rm=T)) &gt; 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 &gt; 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 &gt;.1&amp;%8,10\$ &gt; sales\$Prod &lt;- factor(sales\$Prod, levels=prodprice\$Prod[ order(prodprice\$median, decreasing=T)]) &gt; qplot(Prod, Uprice, data=sales, alpha=I(0.2)) + scale_y_log10() + coord_flip() O55%)#&quot;&gt;AB*2 [0(55+2*%A.1*% )#1B+%)#&quot;&gt;AB*%(.&gt;% 5(#\$+2* Uprice 1e+03 1e+01 1e-01 p3689 Prod p560 Statistics 503, Spring 2013, ISU 14 &gt;.1&amp;%8,10\$ &gt; sales\$Prod &lt;- factor(sales\$Prod, levels=prodprice\$Prod[ order(prodprice\$median, decreasing=T)]) &gt; qplot(Prod, Uprice, data=sales, alpha=I(0.2)) + scale_y_log10() + coord_flip() O55%)#&quot;&gt;AB*2 [0(55+2*%A.1*% )#1B+%)#&quot;&gt;AB*%(.&gt;% 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# &amp;(5BA5(*+%)#&quot;)&quot;#*1&quot;.%&quot;/%01221.\$2%&quot;.%CA(.*%\% D(5%34%2(5+20+.%E%&lt;&quot;%2&quot;0+%2(5+20+.%#+)&quot;#*% 0&quot;#+%)&quot;&quot;#54%*'(.%&quot;*'+#2] [(0+%(\$(1.%/&quot;#%)#&quot;&gt;AB*2%E%O#+%2&quot;0+% )#&quot;&gt;AB*2%#+)&quot;#*+&gt;%0&quot;#+%)&quot;&quot;#54%*'(.%&quot;*'+#2]% Statistics 503, Spring 2013, ISU 15 678-2,1.9%?1##1.9# &gt; totS &lt;- table(sales\$ID) &gt; nas &lt;- sales[which(is.na(sales\$Quant) &amp; is.na(sales\$Val)), c('ID','Prod')] &gt; propS &lt;- 100*table(nas\$ID)/totS &gt; 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