Solved
Contributor
Posts: 35

# Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Hi,

I have the following mock.

Visit           Treatment   N   n (%)      SE        Diff        SE           95% CI                P-value

week x       drug 5mg   X    XX (XX)    XX.XX     XX.XX     XX.XX      XX.XX,  XX.XX        0. XX.XX

Placebo      X    XX (XX)    XX.XX     XX.XX     XX.XX      XX.XX,  XX.XX        0. XX.XX

I have calculated the 95% CI  and the  P-values using Cochran-Mantel-Haenszel Test. I have used the following code.

proc freq data = dat1 ;

output out = dat2 cmh;

tables visit*TRTGRP*AVAL / cmh t norow nopercent relrisk alpha=0.05;

run;

1)  I was wondering if we can calculate both both upper and lower CI values using  Cochran-Mantel-Haenszel Test.

2) Could any one suggest me how to calculate SE and Diff?

Thanks,

Sam.

Accepted Solutions
Solution
‎12-03-2013 03:08 PM
Contributor
Posts: 35

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Thank you very much Fayaz. These are really helpful.

All Replies
Posts: 2,655

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

The standard error of a proportion is estimated as sqrt(p * (1-p) / N), so that should be relatively easy to compute.  I have some difficulty with what the Diff variable is supposed to represent.  I assume it is a difference, but you need to specify what difference you want to compute.  And then calculating the standard error of the difference in proportions would be sqrt [ p1 * (1-p1)/N1 + p2 * (1-p2)/N2].

Steve Denham

Contributor
Posts: 35

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Thanks Steve.

1) I am trying calculate the difference between two treatment groups (Active, Placebo).

2) Could you please let me know the Options in proc freq to get these SE, Difference.

Posts: 2,655

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

I don't know that there are options to get them in the output.  I think you will need to use ODS to get the values into datasets, merge them appropriately, and calculate Difference, SE, and SE of the Difference in a data step.  Maybe someone else that uses PROC FREQ on a more regular basis than me can give additional input.

An alternative would be to use PROC GLIMMIX, which would generate all of these as standard output, and where I could probably be more useful in my answers.

Steve Denham

Message was edited by: Steve Denham

Contributor
Posts: 35

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Hi Steve,

I am a new bee to PROC GLIMMIX, but would be very much interested to know about it. I am aware of anova, proc mixed where we compare more than two treatment groups. I was wondering if it is the same with PROC GLIMMIX.

Posts: 2,655

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

If you could describe your dataset 'dat1' (you know, what variables are in it and something about their characteristics), I think it might be quite easy to pull together PROC GLIMMIX code that addresses your needs.

Steve Denham

Contributor
Posts: 35

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Hi Steve,

The data is in the following way.

USUBJID  STUDYID    Visit           TRTGRP       AVAL

10001     ENL0019      week1        drug 5mg        22.4

10002     ENL0019      week1        drug 10mg        56.2

It has the variables USUBJID, STUDYID, Visit, TRTGRP, AVAL.

USUBJID is the subject identifying number.

Studyid  is the study identifying number.

Visit is the actual visit that the patient visited the hospital.

TRTGRP is the treatment given to the patient like drug 5 mg, 10 mg etc.

AVAL has the lab values collected from subject.

Posts: 2,655

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Interesting.  PROC FREQ and CMH analyses depends on a binomial (yes/no) response, so unless you have a hard and fast cutpoint for AVAL, and include it somehow in the dataset, PROC FREQ is not going to give you what you need..  Here it looks as though your response is a continuous variable.  This is certainly a case for GLIMMIX.  One more question about the variable Visit--what are the possible values that it can take on?  Do you have observations for all subjects at all weeks (worried some about drop-out)?  Once we have this I think a mixed model approach of some sort would be much more appropriate.

Possible code:

proc glimmix data=dat1;

class usubjid studyid visit trtgrp;

model aval=trtgrp visit trtgrp*visit;

random studyid;

random visit/residual type=<this will depend on the values that visit takes on> subject=usubjid;

lsmeans trtgrp visit trtgrp*visit;

lsmestimate <as needed to address results.;

run;

Steve Denham

Contributor
Posts: 35

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Thanks Steve.

The visit variable can take on week 1, week 2, .... up to week 12. There are some drop outs too.

PROC GLIMMIX looks similar to proc mixed. Just wondering what differentiates it from PROC MIXED?

.

Posts: 2,655

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

GLIMMIX is similar, being a mixed model procedure.  It provides different distributions for the dependent variable, which may be critical for lab values, as they are often log normal in their distribution.  It also provides an EFFECT statement, which is useful for fitting splines to repeated measures over time, and which often are superior in the face of drop outs.

In your data, I would do something to get visit into a numeric variable, say studyweek, and try the following:

proc glimmix data=dat1;

class usubjid studyid studyweek trtgrp;

model aval=trtgrp studyweek trtgrp*studyweek;

random intercept studyid/subject=usubjid;

random studyweek/residual type=<AR(1), ARH(1) or perhaps ANTE(1)> subject=usubjid;

lsmeans trtgrp studyweek trtgrp*studyweek/diff;

*lsmestimate <as needed to address results.;

run;

The reason for shifting to studyweek over visit is that it will index the visits in numerical order, while visit will index in alphanumeric, so that week11 would come immediately after week1, and this will invalidate the time dependent error structures.

Steve Denham

Contributor
Posts: 35

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Thank you very much Steve. This is very helpful.

Contributor
Posts: 62

## Re: Confidence intervals and P values using Cochran-Mantel-Haenszel Test

Hi,

I like this pretension for proc GLIMMIX, so I share it with you : http://collaboratory.ucr.edu/files/glimmix.pdf

and this paper is also good to start : https://circle.ubc.ca/bitstream/handle/2429/834/Arrandale_guidance_doc.pdf?sequence=1

Solution
‎12-03-2013 03:08 PM
Contributor
Posts: 35