IFP code

Developed with support from the Institute for Fraud Prevention, the ifpcode package gives some examples of simple social network analysis using Central Registration Depository data from FINRA and/or state securities regulators. Most of the code is concerned with making relationship/adjacency matrices and building variables from them. There are also a few files that calculate some summary statistics about the sample and estimate simple linear models using these variables. The code makes use of a pre-made panel of broker-years and some cleaned-up data on brokers' employment histories and complaint records. Data on registered representatives ("brokers") can sometimes be obtained from state-level regulators or commercial providers. This data can be difficult to work with, so I've packaged up a sample of 20 branches (10 with customer complaints and 10 without) of brokers located in California. The package file can be downloaded from the bottom of this page; the .zip file is a binary package for Windows users, and the .tar.gz file is the source file for everyone else.

The sample provided is small and somewhat idiosyncratic, so patterns or relationships in the included data should NOT be assumed to generalize to the broader population of brokers in the US.

THESE FILES ARE PROVIDED WITHOUT WARRANTY AND MAY CAUSE FLAMES TO SHOOT FROM YOUR COMPUTER!

1) You must have the following packages installed, all of which are available from CRAN:

data.table, stringr, zoo, compiler, Matrix, R.utils, multiwayvcov,

2) To install the necessary packages, run the following line in R:

install.packages(c("data.table", "stringr", "zoo", "compiler", "Matrix", "R.utils", "multiwayvcov"), dependencies = TRUE)

3) If you're using R 3.2.0 or higher on Windows, install the ifpcode package by downloading the zip file and running the following line:

install.packages("C:/Downloads/ifpcode_1.0-2.zip", repos = NULL, type = "binary")

If you're using an older version of R on Windows (you may need Rtools) or running on OS X or Linux, install the ifpcode package by downloading the tar.gz file and running the following line:

install.packages("C:/Downloads/ifpcode_1.0-2.tar.gz", repos = NULL, type = "source")

4) To setup a directory with the example scripts, run the following code in R:

library(ifpcode)

setwd("C:/my/project/directory")

init_pack_files()

5) Before running anything read the file README_FIRST.txt