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;
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;
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.