BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
taylor_metz1
Calcite | Level 5

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;

 

 

cmh.pngtable 2.pngtable 1.pngexcel output.png

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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;

View solution in original post

1 REPLY 1
ballardw
Super User

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 761 views
  • 0 likes
  • 2 in conversation