Code for "Measurement error in continuous endpoints in randomised trials: problems and solutions"
收藏资源简介:
This is the R-code used in the simulation study of the paper 'Measurement error in continuous endpoints in randomised trials: problems and solutions". It generates data, calculates results and makes tables and figures which are shown in the above mentioned paper.<br>By running 0_setup.R, all needed variables and functions are loaded in your R environment.By using 1_generateDatasets.R, datasets (one row for the results of each iteration) are generated. You could either use the provided seed (seed.Rdata) or generate a different seed to generate new results. Generating these datasets will take several days, therefore, the datasets are placed in the other subfolder of this project on figshare.By running 2_loadDatasets.R the datasets will be loaded in your R environment (first save the datasets on your computer, preferably in your working directory, or code the location of the datasets). Save the datasets (in your working directory) in 4 different folders: SME, DME, NAIVE and THETAS (or change the script in order for R to find the saved datasets).By running 3_calcResults.R the results from the datasets are calculated (as shown in corresponding paper). By running visualizeResults.R the results calculated in step 3 are visualized (i.e. plots are made). <br>script.R runs all former scripts and includes code to form the tables and plots (as shown in corresponding paper).<br>



