*! version 1.0.0 08jan2019

checkipaddresses -- Detects Fraud in Online Surveys by Tracing and Scoring IP Addresses

Description

checkipaddresses queries an IP address verification service (iphub.info) that returns the information on IP addresses, including the internet service provider (ISP) and whether it is likely a server farm being
used to disguise a respondent’s location.

checkipadddresses takes a list of IP addresses from the current dataset, checks them against iphub.info,
and creates a dataset (specified with using) with the information it returns. This dataset includes the ip (used for merging),
country code, country name, ASN, ISP, block, and hostname. Especially important in this is the variable "block",
which gives a score indicating whether the IP address is likely from a server farm and therefore
should be excluded from the data:

0 -- Residential or unclassified IP and therefore likely safe

1 -- Non-residential IP (e.g., hosting provider, proxy, etc.); these should likely be excluded.

2 -- Non-residential and residential IPs (more stringent, may flag innocent respondents).

The recommendation from https://iphub.info/ is to block or exclude those who score block = 1.

Users must have an active iphub.info account with a valid X-key. Free accounts allow up to 1,000 queries per day; more queries are available through paid plans.

For more background on the issue of fraudulent survey respondents and how to deal with them, see

Burleigh, Tyler, Ryan Kennedy, and Scott Clifford. 2019.
"How to Screen Out VPS and International Respondents Using Qualtrics: A Protocol (October 12, 2018)." Available at SSRN: https://ssrn.com/abstract=3265459 or
http://dx.doi.org/10.2139/ssrn.3265459.

Syntax

checkipaddresses varname using filename
[if] [in] , xkey(IPHub API key) [replace stub(varname_stub) noisily nocompress]

Options

varname specifies the variable containing IP addresses for survey respondents.

using filename specifies the output dataset to contain information on the IP addresses.

xkey(IPHub API key) specifies your iphub API Key. This is not optional.

replace specifies that the output dataset with information on IP addresses should be replaced if it exists.

stub(varname_stub) specifies a stub that should be pre-pended to the created variables. For example, with the option stub(IP) the block variable would be named 'IPblock' rather than 'block'. This can help avoid variable name conflicts with the original dataset.

noisily specifies that extra output on the command's progress be displayed.

nocompress specifies that the output dataset not be compressed to minimize its size.
The default is to compress the dataset.
This compression involves a preserve and restore of the dataset in memory,
so this option can save time for very large datasets.

Examples

. checkipaddresses IPAddr using ipinformation.dta , xkey(xxxxxxxxxxxxxxx)

. merge m:1 IPAddr using ipinformation.dta

Acknowledgement

This program is adapted from the R package rIp, by Ryan Kennedy, Tyler Burleigh and Scott Clifford.

Author

Nicholas J. G. Winter, Department of Politics, University of Virginia, nwinter@virginia.edu