BookmarkSubscribeRSS Feed
lisahoward
Calcite | Level 5

Hello I wondered if I could get some help me get started with the correct SAS syntax required to perform the following tests on my data.

using the example Cohort/variables I have made up below .

Statistical significance of differences Continuous variables - Wilcoxon rank sum tests prior to matching .

Statistical significance of differences Continuous variables - Wilcoxon signed-rank tests post-match.

Statistical significance of differences Categorical variables,prior to matching will be assessed using chi-squared tests.

Statistical significance of differences Categorical variables, after matching using McNemar’s tests.

                                                      Disease Cohort                        Control Cohort

Cat Variables        Diabetes(yes/no)              1                                           0

                             Gender                              1                                           2

Continuous Variable  Age                             80                                          30

                              

Once I understand the basic syntax I can then incorporate it into a  macro to run over all my categorical and continuous variables.

Many thanks in advance.

6 REPLIES 6
Reeza
Super User

For Wilcoxon use PROC NPAR1WAY

For Chi-Square/McNemar use PROC FREQ

Read the documentation - specifically the Examples section for each, they have worked through examples.

lisahoward
Calcite | Level 5

Thank you for your quick response  when you mention 'Read the documentation - specifically the Examples section for each, they have worked through examples.' Where will I find this? 

Reeza
Super User

What version of SAS are you using?

ballardw
Super User

And when you get into proc freq you don't need to use a macro to "run over all my categorical" variables.

The Tables syntax in proc freq allows you to cross multiple variables:

tables (var1 var2 var3 var4) * (Var5 var6 var7 var8) / <options such a chi-sq tests go here>;

This will do the requested tests for all combinations of the variables in the first () with those in the second ()

Var1*Var5 Var1*Var6 Var1*var7 var1*var8 and so forth.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 1723 views
  • 6 likes
  • 3 in conversation