******************************************************************************************* C source program for the MCEM implementation includes files: deviates.c main.c Metroplis.c utility.c def.h This program was written to fit the data in data.txt with a model with a random intercept: E(Yijk)=logit(ui+beta0+beta1*xijk), where ui~norm(0,sigma^2), xijk is fix effect covariate, and beta0 and beta1 are fixed effect parameters. ******************************************************************************************* The data structure in data.txt has to be in the following format: line 1:# of clusters(sites); line 2:# of groups within the 1st cluster; line 3:# of subjects within the 1st group in the 1st cluster; line 4:the group testing result for the 1st group in the 1st cluster(0/1); line 5:covariate vector(only one covariate here) for all subjects in the 1st group in the 1st cluster; line 6:# of subjects within the 2nd group in the 1st cluster; line 7:the group testing result for the 2nd group in the 1st cluster; line 8:covariate vector for all subjects in the 2nd group in the 1st cluster; .... line 63:# of groups within the 2st cluster; line 64:# of subjects within the 1st group in the 2nd cluster; line 65:the group testing result for the 1st group in the 2nd cluster; line 66:covariate vector for all subjects in the 1st group in the 2nd cluster; line 67:# of subjects within the 2nd group in the 2nd cluster; line 68:the group testing result for the 2nd group in the 2nd cluster; line 69:covariate vector for all subjects in the 2nd group in the 2nd cluster; ..... Any deviation from the above formate requires substantial modification of the source code. ********************************************************************************************* use of the program. Step1: compile the c-source program using any c/c++ compilers such as Unix/Linux GCC or free windows compiler Dev-C++(http://www.bloodshed.net/devcpp.html). Save the executable say, mcem.exe Step2: run mcem.exe under unix console or under cmd.exe mode with windows. Step3: The following prompt will show up to ask for parameter input: datafile: the relative or absolute path for the data file outputfile:the relative/absolute path for output file of the MCEM intemediate parameter estimates nburn:number of "burn-in" steps nskip:number of "skip" steps to avoid correlation in the random sample in MCEM algorithm(this number has to be very small and does not affect the algorithm much) par: initial estimates of parameter monte-carlo sizes:5 different numbers of monte-carlo samples for different stages of algorithm (1-30,31-49,50-69,70-100,>100 steps of iteration) tol:tolerance for convergence ********************************************************************************************** Example: The attached data file data.txt can be fitted using MCEM algorithm by the following parameters: datafile: data.txt outputfile:est.txt nburn:1000 nskip:0 par: -5 1 1 monte-carlo sizes:2000 5000 20000 50000 100000 tol:0.01 The intermediate parameter estimates are dynamically output into est.txt.The last estimate is the estimates upon convergence. ******************************************************************************************** Caution: 1.Please note that in some situations, the convergence may take usually long time to converge, the user has to manually monitor the progression of the algorithm by checking the output estimates. 2.The program is written to fit the attached data file only, any adjustment for other situations require major modification of the source program