Calcite | Level 5

## Help with a Cochran-Mantel-Haenszel Statistics

I am trying to do a simplified "meta-analysis" for a school project, so I made an excel sheet to import into SAS. I have attached screen shots  of some of my output. When I try to find CMH summary statistics, my table looks all wonky and I am not sure how to go about fixing it. How do I get rid of those zeroes?

data meta;
infile "C:\Users\David\Documents\meta.csv" dlm=',' dsd;
input ID author \$ pubyear sdesign \$ expvar \$ ocvar \$ ex:12. unexp:12. total:12.;
run;
proc print data=meta;
run;
proc means data=meta mean q1 median q3 range;
var ex unexp total;
run;
proc freq data=meta;
table sdesign*ex*unexp /cmh;
weight total;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Help with a Cochran-Mantel-Haenszel Statistics

You may have a data structure issue but without knowing more about the project it is hard say. I can see that each value you have for the EX has only one value for the UNEXP

1707  <=> 15372

1714  <=>  44970

8733  <=>  70348

So in effect one determines the other and the "correlation" is 1

I might guess that one or more of those variables actually represents a COUNT of cases for something else. In which case you want to compare the "something else" variables and tell SAS that a value represents a count.

In which case the SAS data set should look something like

ID Author pubyear sdesign expvar  ocvar status count

Where status might be explained/ unexplained and count would be the value  of ex or unexp

and your proc freq code might look like

proc freq data=meta;
table sdesign*status/cmh;
weight count;
run;

Super User

## Re: Help with a Cochran-Mantel-Haenszel Statistics

You may have a data structure issue but without knowing more about the project it is hard say. I can see that each value you have for the EX has only one value for the UNEXP

1707  <=> 15372

1714  <=>  44970

8733  <=>  70348

So in effect one determines the other and the "correlation" is 1

I might guess that one or more of those variables actually represents a COUNT of cases for something else. In which case you want to compare the "something else" variables and tell SAS that a value represents a count.

In which case the SAS data set should look something like

ID Author pubyear sdesign expvar  ocvar status count

Where status might be explained/ unexplained and count would be the value  of ex or unexp

and your proc freq code might look like

proc freq data=meta;
table sdesign*status/cmh;
weight count;
run;

Discussion stats