MissingBias

POST api.scientificmicroservices.com/missingbias

Check whether values in one list make values in another list go missing

MissingBias takes two lists, then runs a significance test to determine whether the value of the first list affects whether the value in the second list is missing.

If values in the first list make values in the second list go missing, MissingBias returns a 1.

Graph of data highlighting a datapoint that is an outlier.
Example usage in terminal

 curl 
--url https://api.scientificmicroservices.com/missingbias \
--header "email:[YOUR_EMAIL]" \
--header "key:[YOUR_API_KEY]" \
--header "Content-Type: application/json" \
--request POST \
--data '{
    "col1":["NA",166.445,470.604,25.0739,49.1652,324.7797,190.9287,"NA",451.39,405.4469,"NA",347.1129,253.0294,141.4462,"NA",241.4338,160.2388,123.1855,51.5936,151.8691,309.7825],
    "col2":[418.3812,"NA",14.552,329.5427,"NA",119.1472,"NA",462.8084,320.5384,148.8701,412.0277,125.1991,"NA",255.8993,441.0706,"NA",297.2804,"NA","NA",296.7565,111.2001]
}'

> ['missing_is_biased':1]



Use the MissingBias endpoint at api.scientificmicroservices.com/missingbias to find whether the data missing in this list:
["NA",166.445,470.604,25.0739,49.1652,324.7797,190.9287,"NA",451.39,405.4469,"NA",347.1129,253.0294,141.4462,"NA",241.4338,160.2388,123.1855,51.5936,151.8691,309.7825]

Depends on the values in this list, noting they are in the same order:
[418.3812,"NA",14.552,329.5427,"NA",119.1472,"NA",462.8084,320.5384,148.8701,412.0277,125.1991,"NA",255.8993,441.0706,"NA",297.2804,"NA","NA",296.7565,111.2001]

My key is [YOUR KEY], and the email to use is [YOUR_EMAIL]


import json
import requests

headers = {
    'email': YOUR_EMAIL,
    'key': YOUR_KEY,
    'Content-Type': 'application/json'
}

url_bias = "https://api.scientificmicroservices.com/missingbias"

col1 = ["NA", 166.445, 470.604, 25.0739, 49.1652, 324.7797, 190.9287, "NA", 451.39, 405.4469, "NA", 347.1129, 253.0294, 141.4462, "NA", 241.4338, 160.2388, 123.1855, 51.5936, 151.8691, 309.7825]
col2 = [418.3812, "NA", 14.552, 329.5427, "NA", 119.1472, "NA", 462.8084, 320.5384, 148.8701, 412.0277, 125.1991, "NA", 255.8993, 441.0706, "NA", 297.2804, "NA", "NA", 296.7565, 111.2001]

sample_data_bias = [
    {"col1": c1, "col2": c2} 
    for c1, c2 in zip(col1, col2)
]

response = requests.post(url_bias, headers=headers, json=sample_data_bias)

bias = response.json()
print("\n--- Missing Bias ---")
print(bias)



library(jsonlite)
library(httr)

url <- "https://api.scientificmicroservices.com/missingbias"

sample_data <- data.frame(
    "col1"= c("NA",166.445,470.604,25.0739,49.1652,324.7797,190.9287,"NA",451.39,405.4469,"NA",347.1129,253.0294,141.4462,"NA",241.4338,160.2388,123.1855,51.5936,151.8691,309.7825),
    "col2" = c(418.3812,"NA",14.552,329.5427,"NA",119.1472,"NA",462.8084,320.5384,148.8701,412.0277,125.1991,"NA",255.8993,441.0706,"NA",297.2804,"NA","NA",296.7565,111.2001))

sample_json <- toJSON(sample_data)
response <- POST(
  url = url,
  add_headers(  'email'= YOUR_EMAIL,
                'key' = YOUR_KEY,
                'Content-Type' = 'application/json'
  ),
  body = sample_json,
  encode = "json"
)

bias <- fromJSON(content(response, as = 'text'))
print(bias)

Input types allowed
Graphic showing that input types allowed are strings, numbers, pair of lists only
Response fields
is_biased 1 or 0, indicating whether the data missing in the first column depends on the value in the second column