The analysis tab allows the user to supply a specific data set for analysis by the design specified in the Design tab of the “.facts” file.


Clicking on the “Use Design to Analyze Data” button, will create an empty “subject.csv” file in the main simulation results directory and an ‘Analysis’ sub-directory there for running the analysis and saving the outputs.
Alternatively, clicking on the “Import Data to Analyze” launches a file browser, allowing the user to select a ‘.csv’ file to load as the data to analyze. This is a shortcut for first clicking on the “Use Design to Analyze Data” button, and then clicking on the “Select File to Create New Analysis” button on the subject data tab.


After enabling data analysis, the analysis screen is shown with no data loaded. By clicking on the “Subject Data” tab the user is now able to enter data values directly, or to load a ‘.csv’ file already containing data:


Entering the data directly
For a typical FACTS Core trial, there are normally too many subjects to want to enter the data directly, but it is possible. Also if data is first loaded from an external file, it is presented in the same grid as that used for data entry and additional data can be added or existing data modified.
The data format is the same as the ‘patientsNNNN.csv’ output file from simulations, so it is easy to use these as the basis for a trial analysis.
- Subject ID
- FACTS does not use this value, it is there to allow the data to be cross-referenced to an external data source. If not required there is no harm simply entering ‘1’ on each row.
- Region ID
- Region ID is a value output from FACTS simulation, reflecting the recruiting region the simulated subject was recruited in. It is not used in analysis, if a region ID is not available there is no harm simply entering ‘1’ for each subject.
- Date
- Date is a real number indicating when the subject was recruited in weeks This value is in weeks from FACTS 7.0 onwards - before that it was in days. from the start of the trial. It is output from FACTS simulation, it is not used in analysis. If a date is not available there is no harm simply entering ‘1’ for each subject.
- Dose Index
- Dose index indicates which arm the subject was randomized to. The index of each arm is visible on the Study > Treatment Arms tab. Index ‘1’ is the Control arm if a Control is present.
- Last Visit#
- Last Visit# is the index of last visit for which there is data for the subject. Previously FACTS could not process data with data missing from visits before the last visit. From FACTS 6.2 this is now possible. Visits for which no data is available should be given the value “-9999”. Data supplied for a subject’s visits after ‘Last Visit#’ is ignored.
- Dropout
- Dropout is a flag, value ‘0’ (not dropped out) or ‘1’ (dropped out). For a subject that has dropped out, FACTS will apply the defined value for the subject from the ‘Last Visit#’.
- Baseline
- This should be the subjects baseline score if baseline is being analyzed, otherwise it is ignored. For non-baseline trials and dichotomous trials this can be -9999.
- Visit1, …
- These are the subjects response values at the defined visits, up to and including the final visit. There should be 1 column per non-baseline visit.
- Subject ID
- FACTS does not use this value, it is there to allow the data to be cross-referenced to an external data source. If not required there is no harm simply entering ‘1’ on each row.
- Region ID
- Region ID is a value output from FACTS simulation, reflecting the recruiting region the simulated subject was recruited in. It is not used in analysis, if a region ID is not available there is no harm simply entering ‘1’ for each subject.
- Date
- Date is a real number indicating when the subject was recruited in weeksThis value is in weeks from FACTS 7.0 onwards, before that it was in days. from the start of the trial. It is output from FACTS simulation, it is not used in analysis. If a date is not available there is no harm simply entering ‘1’ for each subject.
- Dose Index
- Dose index indicates which arm the subject was randomized to. The index of each arm is visible on the Study > Treatment Arms tab. Index ‘1’ is the Control arm if a Control is present.
- Dropout
- Dropout is a flag, value ‘0’ (not dropped out) or ‘1’ (dropped out). For a subject that has dropped out, FACTS will apply the defined value for the subject from the ‘Last Visit#’.
- Duration
- The current time for which the subject has been observed, in weeks. Also called exposure. May be time to event, time to dropout, or time of follow-up observed without observing an event yet.
- Outcome
- Whether a primary endpoint event has been observed or not for this subject. If the primary event has been observed, then ‘Duration’ should be the time to that event from the start of observation of the subject.
- Predictor value
- If a predictor is being using, this should be the value of the predictor endpoint for the subject. For a continuous predictor it’s change from baseline, for a dichotomous predictor it is 0 (no reponse) or 1 (response). For a time-to-event predictor it’s the current duration (or exposure) for the subject on the predictor endpoint.
- Predictor outcome
- If a time-to-event predictor is being used, this should be ‘0’ if no predictor event has been observed, and ‘1’ if a predictor event has been observed. Otherwise leave this field as ‘0’ (or ‘-9999’ if preferred), it’s ignored.
To enter data directly for a multiple endpoint trial, the process is exactly like the continuous/dichotomous data entry - with 1 exception. The Last Visit, Baseline, and Visit Response columns are repeated for each endpoint.




If data is entered and then ‘Run Analysis’ clicked, the data is saved to a file called ‘patients.dat’ and the analysis results saved to a folder called ‘Analysis’ within the “_results” folder of the design.

The ‘Save As’ button can be used to save the file with a different name, but it will still be saved within the _Results folder.
A specific results folder is also created, called ‘Analysis_<file name>’.
Loading Data From a File
As well as entering the data via FACTS its possible to load the data from a ‘subject.csv’ file. These can be created within FACTS or outside of FACTS and once created can be edited FACTS or outside of FACTS.
The subject.csv file format
The file is a simple ascii file with the different data items separated by commas. Any line starting with ‘#’’ is ignored, here we use that to include a header row. The data may also include spaces to aid readability (but not, currently, tabs). Each line defines the dose given to a single subject and that subject’s response.
The format of the file is the same as the ‘patientsNNNN.csv’ output file (continuous/dichotomous, time-to-event), or multiple endpoint and the column values described above.
Converting arrival date value from days to weeks
From FACTS 7.0 the value in the Date field is interpreted as being in weeks (rather than days as in previous versions). If you have existing data, a simple conversion tool is provided “Convert Date from Days to Weeks” that simply divides all of thete values by 7. Having run the conversion, you then need to save the modified data. The values of the Date field will only make a difference to TTE analyses.


Data file management on the Analysis tab
From FACTS 6.2 onwards FACTS now supports multiple subject data files and analysis folders.
Buttons that allow the subject data file to be changed:
’Select File to Create New Analysis: launches a file browser that allows the user to select a new “.csv” file from any location. The selected file is copied to the “_Results” folder (retaining its current name) and made the current subject data file.
‘Rename Current Analysis’ allows the name of the current subject data file to be changed.
‘Select Difference Analysis’ allows a different subject data file that is in the “_Results” folder to be made the current subject data file.
‘Delete Analysis’ allows any of the subject data files that are in the “_Results” folder to be deleted.
The name of the current subject data file and the name of the corresponding analysis folder are shown below the subject data file buttons.
There are five buttons that allow the currently loaded subject data file to be modified:
‘Delete Row’ deletes the currently selected row in the data grid. The data in the current subject file is not updated unless the current data is saved.
‘Delete All’ clears all the data in the data grid. The data in the current subject file is not updated unless the current data is saved.
‘Reload data’ replaces the data in the data grid with the data that is still in the current subject data file.
‘Save As’ saves the current data in the data grid to a new subject data file in the “_Results” folder, and makes that the current subject data file.
“Save” saves the current data in the data grid to the current subject data file.
Running an analysis performs a ‘Save’ before running the analysis.
Running an Analysis
Once data has been loaded or entered, the user can click the ‘Run Analysis’ button.
Once the analysis has run, FACTS displays the recommendation, and a graph showing the data.




Analysis Options
At the top of the analysis tab there are various parameters that can be set to control the analysis performed:



The MCMC parameters:
“Burn-in” for the number of initial samples that are discarded
“Length” for the number of samples drawn to form the posterior distributions
Random number seed that can be set to generate a different sampling sequence
Whether an MCMC file is to be output (which enables the ability to view sample history graphs for the model parameters).
The command line parameters that go into the actual call to the FACTS code can be modified, which allows expert users to enter command line parameters to be passed to the design engine that are not settable through this panel.
Current trial analysis context:
The user specifies which interim the analysis is for and hence which decision criteria to be applied
The user supplied the interim analysis number or
Selects “Do Final Analysis” which causes the analysis to use the final evaluation success/futility criteria.
The user specifies the current week of the trial if the amount if information defined by “opportunity to complete” is required.
If this is an arm dropping design, it is possible to flag which, if any, doses have already been dropped and hence to be excluded from future adaptation decisions, but included in the analysis [this can be used even if the design is not an arm dropping design – to allow for an arm being dropped for reasons outside the scope of the simulation, such as logistical or safety reasons but only be entering the ‘-armsdropped’ command line parameter the control is only displayed if the design includes arm dropping].