Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: SAS equivalent command


From   "b. water" <[email protected]>
To   [email protected]
Subject   RE: st: SAS equivalent command
Date   Mon, 12 Dec 2005 19:54:23 +0000

thanks Dan for your codes. i saw it in action and helped me to understand the commands. following your posting, i have also had the opportunity to run the routine in SAS elsewhere. when i saw the output i realised that:

=============================================================

/*
In the next step we create a special dataset that contains the 44 calculated variances of logit sensitivity and the 44 variances of specificity in each study. Three additional records are created which contain the starting values for the 3 additional variance parameters of the bivariate model: record 1 holds the starting value for the between-study variance in logit sensitivity, record 2 the covariance between logit sensitivity and specificity, and record 3 the between-study variance in logit specificity
*/

data cov;

/* start the file with three starting values for (co)variance parameters of the random effects (zero works well) SAS expects the name est for this variable
*/

if _n_ eq 1 then do;
est = 0; output; est =0; output; est = 0; output;
end;

/* followed by the 88 calculated variances of sensitivity and specificity of each study */

set bi_meta;
est = var_logit; output;
keep est;
run;

=============================================================

does not concatenate the 3 new observations (appended) to the bi-meta.dta instead it creates a separate covariance data set i.e. cov.dta with 91 variables, where the first three observations are three trailing zero's (see below output from SAS) before the 88 variances.

NOTE: There were 88 observations read from the data set WORK.BI_META.
NOTE: The data set WORK.COV has 91 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

=============================================================

having come this far and the data sets (bi_meta.dta and cov.dta) are prepared (i think! and many thanks to Dan Blanchette's help) for gllamm, i need to ask those in the know about gllamm (Stata) and Proc Mixed (SAS) as to what would be the equivalent of the following SAS's Proc Mixed in Stata's gllamm (if any):

1. settings of degrees of freedom to obtain p-values based on normal distribution rather than t-distribution,

2. random effects with possible correlation (i.e. unstructured covariance structure),

3. 'repeat' statement,

4. parms (i.e. covariance parameters) i.e. making use of the cov.dta file (and how in Stata?)

i have included again the Proc Mixed statement that was appendixed on the paper i quoted earlier in the thread.

=============================================================

proc mixed data=bi_meta method=reml cl ; /* option cl will give confidence intervals */

/* study_id and modality are categorical variables */
class study_id modality;

/* model statement: asking for different estimates of mean sensitivity and specificity for each modality, provide large value for degrees of freedom to obtain p-values based on normal distribution rather than the t-distribution (=default in SAS)
*/

model logit = dis*modality non_dis*modality / noint cl df=1000, 1000, 1000, 1000, 1000, 1000;

/* random effects for logit sensitivity and specificity with possible correlation (UN=unstructured covariance structure) */

random dis non_dis / subject=study_id type=un ;

/* use the repeat statement to define different within-study variances for sens and spec in each study */

repeated / group=rec;

/* name the file holding the all the (co)variances parameters, keep the within-study variance constant */

parms / parmsdata=cov hold=4 to 91;

/* use contrast statement for testing specific hypotheses */

/* testing for differences in sensitivities */
contrast �CT_sens vs LAG_sens� dis*modality 1 -1 0 / df=1000 ;
contrast �CT_sens vs MRI_sens� dis*modality 1 0 -1/ df=1000 ;
contrast �LAG_sens vs MRI_sens� dis*modality 0 1 -1/ df=1000 ;

/* testing for differences in specificities */
contrast �CT_spec vs LAG_spec� non_dis*modality 1 -1 0 / df=1000 ;
contrast �CT_spec vs MRI_spec� non_dis*modality 1 0 -1/ df=1000 ;
contrast �LAG_spec vs MRI_spec� non_dis*modality 0 1 -1/ df=1000 ;

/* testing for differences in DOR */
contrast �CT_odds vs LAG_odds � dis*modality 1 -1 0 non_dis* modality 1 -1 0 / df=1000 ;
contrast �CT_odds vs MRI_odds � dis* modality 1 0 -1 non_dis* modality 1 0 -1 / df=1000 ;
contrast �LAG_odds vs MRI_odds � dis* modality 0 1 -1 non_dis* modality 0 1 -1 / df=1000 ;

run;

=============================================================

my understanding (again, i think!) so far is that SAS's Proc Mixed 'class' is handled by Stata's gllamm i(varlists) whilst interaction terms dis*modality and non_dis*modality are generated before calling gllamm. the noint option in SAS Proc Mixed would be nocons in Stata's gllamm while 95% CI is an a default setting in Stata's gllamm. however i cannot built a gllamm model that give an output as published in the article:

Imaging modality Mean sensitivity (95% CI) Mean specificity (95% CI) Mean DOR (95% CI)
LAG 0.67 (0.57 to 0.76) 0.80 (0.73 to 0.85) 8.13 (5.16 to 12.82)
CT 0.49 (0.37 to 0.61) 0.92 (0.88 to 0.95) 11.34 (6.66 to 19.30)
MRI 0.56 (0.41 to 0.70) 0.94 (0.90 to 0.97) 21.42 (10.81 to 42.45)

Imaging modality Mean sensitivity (95% CI) Mean specificity (95% CI) Mean DOR (95% CI)
LAG 0.67 (0.57 to 0.76) 0.80 (0.73 to 0.85) 8.13 (5.16 to 12.82)
CT 0.49 (0.37 to 0.61) 0.92 (0.88 to 0.95) 11.34 (6.66 to 19.30)
MRI 0.56 (0.41 to 0.70) 0.94 (0.90 to 0.97) 21.42 (10.81 to 42.45)

P-value LAG vs. CT 0.023 0.0002 0.35
P-value LAG vs. MRI 0.23 0.0001 0.021
P-value CT vs. MRI 0.47 0.34 0.15

i've looked at www.gllamm.org website to check gllamm's manual (pdf) but unless i am missing something (e.g. very real lack of understanding of the model) i could not find a way to apply gllamm in this situation. again, i am grateful for advice/help on how to proceed from here on and also, needless to say, apology for an extensive and perhaps over-verbose postings.

kind regards,
bw

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee� Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index