Contributor
Posts: 57

# Statistical significance differences syntax

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.

Super User
Posts: 20,781

## Re: Statistical significance differences syntax

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.

Contributor
Posts: 57

## Re: Statistical significance differences syntax

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?

Super User
Posts: 20,781

## Re: Statistical significance differences syntax

What version of SAS are you using?

Contributor
Posts: 57

9.2

Super User
Posts: 20,781

## Re: Statistical significance differences syntax

Assuming SAS 9.4 here's the one for PROC FREQ.

Base SAS(R) 9.4 Procedures Guide: Statistical Procedures, Second Edition

Super User
Posts: 11,838

## Re: Statistical significance differences syntax

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.

Discussion stats
• 6 replies
• 418 views
• 6 likes
• 3 in conversation