turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Confidence intervals and P values using Cochran-Ma...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-02-2013 10:11 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to MohammadFayaz

12-03-2013 03:08 PM

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sampath

12-03-2013 08:30 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-03-2013 11:05 AM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sampath

12-03-2013 11:11 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-03-2013 11:44 AM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sampath

12-04-2013 08:35 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-04-2013 10:52 AM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sampath

12-05-2013 09:51 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-05-2013 07:54 PM

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?

.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sampath

12-06-2013 08:48 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-09-2013 11:14 AM

Thank you very much Steve. This is very helpful.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sampath

12-03-2013 02:44 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to MohammadFayaz

12-03-2013 03:08 PM

Thank you very much Fayaz. These are really helpful.