BSTVCUser Guide
Desktop website ↗Download software

Binary: COVID-19 occurrence

Convert monthly source data, fit a logistic model, and interpret probabilities and spatiotemporal contribution.

Download this caseGo to the workflow ↓

Know the data

This case concerns recorded COVID-19 occurrence in 31 mainland Chinese provincial units during the 12 months of 2020. The outcome is binary: 0 = no occurrence; 1 = occurrence. The source manual describes National Health Commission records, remote-sensing and environmental indicators, and Baidu mobility data.

File / fieldMeaning
Covid_Binary_Panel.xlsxOriginal wide table: 31 rows, with monthly columns; convert before modeling
COVID-19-Ready-Panel.csvAdded ready-to-import panel: 372 rows, preserved values
China Provincial Map/China Provincial Map.*31-unit map, with the shared gb identifier
gbProvince code; preserve exact values and check its imported type
Month1 through 12, representing January–December 2020
covidBinary response in the ready panel and recommended conversion
PM25, Temp, NDVI, NTLAir quality, temperature, vegetation, and nighttime-light indicators
Total_In, Total_OutInterprovincial incoming and outgoing mobility indices

1. Convert the original wide table

  1. Open Data Conversion, browse to Covid_Binary_Panel.xlsx, and select Load Data for Conversion.
  2. Check that the preview has 31 provincial rows and that time-specific columns are visible.
  3. Enter the conversion settings below. Treat gb as the invariant spatial identifier; the month belongs in a new column.
ParameterValue
ID columnsgb (optionally retain name as an invariant attribute)
Time Sequence1:12
New Time Column NameMonth
Number of Variables to Convert7
Binary case: the original wide source table loaded for conversion.
Binary case: the original wide source table loaded for conversion. Click to enlarge.

For each variable, select the start and end columns below, then choose Select by Range. Each selection must contain exactly 12 columns, ordered January to December. If columns are not contiguous, select them individually in that same order. The spelling and capitalization below match the supplied workbook.

New variable nameStart columnEnd column
PM25PM25202001PM25202012
TempTemp202001Temp202012
NDVINDVI202001NDVI202012
NTLNTL202001NTL202012
Total_InTotal_In202001Total_In202012
Total_OutTotal_Out202001Total_Out202012
covidCovid_binary202001Covid_binary202012
  1. After configuring all seven variables, select Start Conversion.
  2. Confirm 372 rows (31 × 12), with columns gb, Month, PM25, Temp, NDVI, NTL, Total_In, Total_Out, covid.
  3. Download the converted table as CSV or Excel. Save it with a distinct name, such as COVID-19-Converted-Panel.xlsx; preserve the original workbook.
Binary case: conversion result and panel download controls.
Binary case: conversion result and panel download controls. Click to enlarge.

2. Import and validate

  1. Open Data Input and use the modeling table Browse control to select COVID-19-Ready-Panel.csv (or your saved converted panel).
  2. In the map Browse control, select the complete China Provincial Map shapefile component set.
  3. Leave the custom matrix input empty for the default neighborhood.
  4. Select Load and Validate Input.
  5. Review Data Table field properties, types, missing-value ratios, and raw preview. Then review Map field properties and the boundary preview.

Inspect covid: its only non-missing values should be 0 and 1. Province names are human-readable labels, while gb is the matching key. The original workbook stores codes numerically and the map stores them as text, so inspect their types and normalize them consistently if the importer does not do so.

Binary case: loaded panel and field properties.
Binary case: loaded panel and field properties. Click to enlarge.
Binary case: the 31-unit province map preview.
Binary case: the 31-unit province map preview. Click to enlarge.

3. Check spatial order

  1. Open Data Check and select the BSTVC spatiotemporal panel check mode.
  2. Set Time Field to Month and Space Field to gb.
  3. Select Run Check and read the log. Confirm the full set of map identifiers has matched.
  4. If the application reports automatic rearrangement, export the checked table for your records and use Checked Data during modeling. If it reports an already aligned order, use Raw Data.

Expect 31 map units for each of 12 months. If any identifier fails to match, resolve the value or type mismatch before continuing. An alphabetically sorted province list is not the map’s internal order.

Binary case: automatic spatial-order checking and alignment.
Binary case: automatic spatial-order checking and alignment. Click to enlarge.

4. Configure and run the logistic model

ParameterChoose
Response Variable Ycovid
Explanatory Variables XPM25, Temp, NDVI, NTL, Total_In, Total_Out
Response TypeBinary (logistic)
Time FieldMonth
Space Fieldgb
Data SourceRaw Data if already aligned; Checked Data if rearranged
Standardize X VariablesYes for the demonstrated comparisons
Spatial weight matrixDefault QUEEN-B
Threads6 as the starting setting
Binary case: logistic model settings and selected predictors.
Binary case: logistic model settings and selected predictors. Click to enlarge.
  1. Open BSTVC modeling and enter the settings listed above.
  2. Recheck the response family, time field, spatial field, and Data Source. Do not substitute IDs or time for explanatory variables.
  3. Select Run Model once and wait for the progress message to finish.
  4. When the result table appears, select Download All Tables. Save the workbook as COVID-19_all_result.xlsx in your case output folder.
  5. Keep the checked input table, map, chosen variables, neighborhood, thread setting, software version, and any error log with that workbook.
Binary case: completed model output.
Binary case: completed model output. Click to enlarge.

5. Interpret effects and relative contribution

The temporal and spatial coefficients are on the model’s log-odds scale. A positive coefficient indicates an association with higher modeled odds conditional on the specification; it is not an absolute increase in probability. Standardized predictors change the unit of coefficient interpretation.

STVPI can summarize relative factor contributions and their uncertainty. In the documented desktop version, logistic models lack the residual component needed for the overall model explainable percentage. Do not label a relative contribution chart as total explained outcome variation.

Source example: monthly temporal coefficients and credible intervals.
Source example: monthly temporal coefficients and credible intervals. Click to enlarge.
Source example: spatial coefficient maps for the binary model.
Source example: spatial coefficient maps for the binary model. Click to enlarge.
Source example: relative spatiotemporal contribution components.
Source example: relative spatiotemporal contribution components. Click to enlarge.

6. Examine probabilities and predictive discrimination

Read predict_y as a predicted probability and verify it lies between 0 and 1. Map probabilities using a common 0–1 scale across months. If a decision needs a yes/no label, state a justified threshold; do not assume a threshold was automatically validated by the model.

An ROC curve plots sensitivity against the false-positive rate over thresholds. AUC summarizes discrimination, but does not assess calibration and is not a causal result. The source figure below is a historical fitted-data illustration. For a prediction claim, use held-out data, exclude records with unavailable outcomes, and report how validation was designed.

Historical binary example: ROC curve and AUC, illustrating discrimination.
Historical binary example: ROC curve and AUC, illustrating discrimination. Click to enlarge.
Historical binary example: monthly predicted probability maps.
Historical binary example: monthly predicted probability maps. Click to enlarge.

The R accuracy example fixes the positive class to 1 and the ROC direction, so the evaluation follows the stated event definition rather than choosing the direction from the data.

7. Save a reproducible record

Keep the original wide workbook, converted or ready panel, checked data, map components, settings, result workbook, and missingness notes together. Continue to Understand results and R visualization, or try the smaller count case.