# A Digital Twins Machine Learning Model for Forecasting Disease Progression in Stroke Patients
## 4 Statistical Analysis  
Our statistical analysis included several methods of interrogating the simulated data to identify potential discernible differences between the simulated and real data with respect to distribution and correlations of all measured covariates (Table 1). We examined the distribution of individual covariates through a number of statistical tests. First, two-sample \(t\)-tests were used to compare covariate distributions in the real and simulated data. Second, a number of aspects of real and simulated patient data were plotted against each other and slopes and correlation coefficients were assessed. Plotted aspects of the data were log-transformed feature means, log-transformed feature standard deviations, and feature correlations with 0, 90 and 180 day lags. For the feature mean plots, each point on the plot corresponded to a single feature (e.g., MCV or PTT). The x-coordinate for the plot corresponded to the feature's mean in the real data, and the y-coordinate corresponded to the feature's mean in the simulated data. For a perfect model, all of these points would fall along a line of slope one; i.e., the feature means in the real and synthetic data would match exactly. For standard deviation plots, features were plotted identically but for standard deviations of each feature rather than means. Feature correlations were plotted as follows. Two different features were selected and their correlation computed within each data type; i.e., the correlations were computed for the real data's features alone and the generated data's features alone. Each correlation was plotted as a single point on the graph, with the x-coordinate representing the correlation between the features in the real data and the y-coordinate representing the correlation between the same features in the generated data. The lag time reflected the difference between the time at which the two features were measured, in months. We additionally plotted the covariance of the real and simulated data to compare covariance structures graphically. Finally, we plotted projected timelines for each measure. To compute projected timelines, the last two measurement vectors in a time window vector of real patient data were joined with a copy of the last measurement vector, i.e., using the last observation carried forward. The VAE model was then used to fill in the imputed values with a simulated version, creating a random sample of the next measurement vector. This was iterated to create a trajectory of desired length, and the entire process was repeated to create 25 generated trajectories for the patient. These simulated trajectories were then compared to the distribution of real patient data observed at the same time points in the data. Additionally, we trained a logistic regression model as an adversary to classify streams of patient data as either real or simulated. Unlike when such models are built for predicting patient outcomes or disease status, where high area under the receiver operating characteristic (AUROC) is the objective, the objective for the present study was to be unable to train a model which distinguished between the two data sources. The logistic regression model was trained using five-fold cross validation, where the data was partitioned into five portions. The model was trained on four of the portions and tested on the fifth, with the