Hello friends of R list,<br><br>Im trying for a while to adapt a function develped in SAS and published in &quot;J.B. Reitsma et al. / Journal of Clinical Epidemiology 58 (2005) 982–990&quot;, wich is a bivariate approch to meta-analysis of diagnotic tests. 
<br><br>Since Im not a statistics or R expert, neither I have any SAS knowledge, Im having a hard time trying to do so.<br><br>There is an appendix at the original txt with some step by step on how to do it but Im stuck on a more advanced stuff which I cant find a solution.
<br><br>In a step it is mentioned a Van Houwelingen approach wich I dont know what it is, and so I can work it out. Also there a REML approach which I could not find in any library so far. <br><br>This is the function so far....
<br><br>bivar&lt;-function(TP,FP,FN,TN){<br><br>&nbsp; &nbsp; &nbsp; &nbsp; # find a way to sum 0.5 to each null cell &nbsp;  <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Se&lt;-TP/(TP+FN)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sp&lt;-TN/(TN+FP)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logSe&lt;-log(Se/(1-Se))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logSp&lt;-log(Sp/(1-Sp))
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vlogSe&lt;-1/(Se*(1-Se)*(TP+FN))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vlogSp&lt;-1/(Sp*(1-Sp)*(TN+FP))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bsvlogSp&lt;-0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cblog&lt;-0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bsvlogSp&lt;-0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sdata&lt;-rbind(bsvlogSp,cblog,bsvlogSp,vlogSe,vlogSp)
<br><br>this is the SAS sintax available at the original text.....<br><br>/*<br>Use the Proc Mixed module in SAS is used to set up the bivariate model. We apply the approach of Van Houwelingen et al<br>to incorporate both the within and between study variance, more details and explanations can be found there.{van Houwelingen,
<br>2002 #2} Use the restricted maximum likelihood estimation (REML) method in estimating the model<br>*/<br>proc mixed data=bi_meta method=reml cl ; /* option cl will give confidence intervals */<br>/* study_id and modality are categorical variables */
<br>class study_id modality;<br>/* model statement: asking for different estimates of mean sensitivity and specificity for each modality, provide large value<br>for degrees of freedom to obtain p-values based on normal distribution rather than the t-distribution (=default in SAS) */
<br>model logit  dis*modality non_dis*modality / noint cl df=1000, 1000, 1000, 1000, 1000, 1000;<br>/* random effects for logit sensitivity and specificity with possible correlation (UN=unstructured covariance structure) */
<br>random dis non_dis / subject=study_id type=un ;<br>/* use the repeat statement to define different within-study variances for sens and spec in each study */<br>repeated / group=rec;<br>/* name the file holding the all the (co)variances parameters, keep the within-study variance constant */
<br>parms / parmsdata=cov hold=4 to 91;<br>/* use contrast statement for testing specific hypotheses */<br>/* testing for differences in sensitivities */<br>contrast 'CT_sens vs LAG_sens' dis*modality 1 -1 0 / df=1000 ;<br>
contrast 'CT_sens vs MRI_sens' dis*modality 1 0 -1/ df=1000 ;<br>contrast 'LAG_sens vs MRI_sens' dis*modality 0 1 -1/ df=1000 ;<br>/* testing for differences in specificities */<br>contrast 'CT_spec vs LAG_spec' non_dis*modality 1 -1 0 / df=1000 ;
<br>contrast 'CT_spec vs MRI_spec' non_dis*modality 1 0 -1/ df=1000 ;<br>contrast 'LAG_spec vs MRI_spec' non_dis*modality 0 1 -1/ df=1000 ;<br>/* testing for differences in DOR */<br>contrast 'CT_odds vs LAG_odds ' dis*modality 1 -1 0 non_dis* modality 1 -1 0 / df=1000 ;
<br>contrast 'CT_odds vs MRI_odds ' dis* modality 1 0 -1 non_dis* modality 1 0 -1 / df=1000 ;<br>contrast 'LAG_odds vs MRI_odds ' dis* modality 0 1 -1 non_dis* modality 0 1 -1 / df=1000 ;<br>run;<br><br>attached there is a dataset...
<br><br>If anyone could give me a hand or any tip, it would most welcome!<br><br>Best regards to all,<br><br clear="all">-- <br>Abraço forte e que a força esteja com você,<br>Pedro Emmanuel