Programming the statistical procedures from SAS

Statistical significance differences syntax

Reply
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.

Many thanks in advance.

Grand Advisor
Posts: 16,875

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? 

Grand Advisor
Posts: 16,875

Re: Statistical significance differences syntax

What version of SAS are you using?

Contributor
Posts: 57

Re: Statistical significance differences syntax

9.2

Grand Advisor
Posts: 16,875

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

Grand Advisor
Posts: 10,043

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.

Ask a Question
Discussion stats
  • 6 replies
  • 370 views
  • 6 likes
  • 3 in conversation