3-cs-fraudulent-transactions

Isnasales inspresult fraud ok 008072718 091927282

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: $Insp <- ifelse(sales$Insp=="unkn", "no", "yes") table(sales$Insp) Split into two variables: inspected or not, fraud or not no yes 385414 15732 > table(sales$Insp)/nrow(sales) Only 4% of records are inspected no yes 0.96078236 0.03921764 > sales$Insp.result <- as.character(sales$Insp.result) > sales$Insp.result[sales$Insp.result=="unkn"] <- NA > sales$Insp.result <- factor(sales$Insp.result) > table(sales$Insp.result) fraud ok 1270 14462 > table(sales$Insp.result)/nrow(sales[!is.na(sales $Insp.result),]) fraud ok 0.08072718 0.91927282 Statistics > > > > 503, Spring 2013, ISU ;.#8$0&12.# 6 sales$Insp.result <- sales$Insp sales$Insp <- as.character(sales$Insp) sales$Insp <- ifelse(sales$Insp=="unkn", "no", "yes") table(sales$Insp) Split into two variables: inspected or not, fraud or not no yes 385414 15732 > table(sales$Insp)/nrow(sales) Only 4% of records are inspected no yes 0.96078236 0.03921764 > sales$Insp.result <- as.character(sales$Insp.result) > sales$Insp.result[sales$Insp.result=="unkn"] <- NA > sales$Insp.result <- factor(sales$Insp.result) > table(sales$Insp.result) Of the records inspected, how many are fraudulent fraud ok 1270 14462 > table(sales$Insp.result)/nrow(sales[!is.na(sales $Insp.result),]) fraud ok 0.08072718 0.91927282 Statistics 503, Spring 2013, ISU 6 > > > > ;.#8$0&12.# sales$Insp.result <- sales$Insp sales$Insp <- as.character(sales$Insp) sales$Insp <- ifelse(sales$Insp=="unkn", "no", "yes") table(sales$Insp) Split into two variables: inspected or not, fraud or not no yes 385414 15732 > table(sales$Insp)/nrow(sales) Only 4% of records are inspected no yes 0.96078236 0.03921764 > sales$Insp.result <- as.character(sales$Insp.result) > sales$Insp.result[sales$Insp.result=="unkn"] <- NA > sales$Insp.result <- factor(sales$Insp.result) > table(sales$Insp.result) Of the records inspected, how many are fraudulent fraud ok 1270 14462 > table(sales$Insp.result)/nrow(sales[!is.na(sales $Insp.result),]) fraud ok 0.08072718 0.91927282 Statistics About 8% 503, Spring 2013, ISU 6 > totS <- table(sales$ID) > length(totS) [1] 6016 > head(totS) <"-$# v1 v2 v3 v4 v5 v6 96 50 26 549 33 61 > head(sort(totS, decreasing=T), 20) # Top 20 sale...
View Full Document

This note was uploaded on 02/06/2014 for the course STAT 503 taught by Professor Staff during the Fall '08 term at Iowa State.

Ask a homework question - tutors are online