turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Wilcoxon help--new SAS student

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-02-2015 09:07 PM

I have run preliminary procedures and have determined that my data is nonparametric...I need to measure the difference in answers between a post-test and a pre-test. For normal data, I would, of course, run a paired t-test, but that won't help me in this case.

Everything that I have found is way above my head--I have only been using SAS for a couple of months now and it's all been for normal data...and, for the most part, as directed by my instructor.

I have two variables posttestanswer and pretestanswer.

Everything I can find talks about defining a data set, but my data set is already input into SAS and saved.

I've tried

answerdiff=posttestanswer - pretestanswer;

and that doesn't work...in part because apparently I'm not appropriately defining "answerdiff" but I'm not sure how to do that in this case. And, once I get the silly part defined, then I need help with the proc statement...best I can tell I'd use a proc univariate with the newly identified "answerdiff" for my variable.

Thank you in advance for any help you can provide. Eventually I'll get this...

Kate

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ksmielitz

04-02-2015 11:18 PM

So assuming you have a dataset with two variables you could do the following:

data step1;

set HAVE;

answerdiff=posttestanswer - pretestanswer;

run;

You could then use PROC UNIVARIATE on the step1 dataset.

proc univariate data=step1;

var step1;

run;

You can also look at PROC NPAR1WAY tests:

proc npar1way data=step1 wilcoxon;

var answerdiff;

run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

04-03-2015 07:02 AM

Reeza,

Thank you for responding!

I get into SAS now and give it a shot!

Kate

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

04-03-2015 08:11 AM

Reeza,

Apologizing in advance for my blatant ineptitude...

I tried what you suggested and keep getting these errors:

25 data step1;

26 set HAVE; (I have also substituted in the name of my data and my set and tried it every which way I can think of.)

ERROR: File WORK.HAVE.DATA does not exist.... or

ERROR: Libref ATC_DATA is not assigned or

ERROR: File WORK.ATC_DATA.DATA does not exist

27 answerdiff=postidstolen - preidstolen;

28 run;

So, with that said...if you don't mind holding my hand a little more...

I've done my proc import. Data file is in and set to run.

data ATC_data;

set ATC_data.fcs;

I then have identified my variables:

*preidstolen;

if preidstolen in (1:5) then do;

SD=preidstolen=1;

and so on through

SA=preidstolen=5;

end;

*postidstolen;

if postidstolen in (1:5) then do;

see preidstolen for breakdown.

So, now I want to define "stolendiff" (stolendiff=postidstolen-preidstolen) but I can't figure out how to get it to work

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ksmielitz

04-03-2015 10:29 AM

I think Both of your method are right . If there are some other variables ,I would consider Covariance Analysis by proc glm .

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

04-03-2015 12:17 PM

I'm going to keep plugging along at it.

There are some other variables...I am back in the stats game after 10 years off (and the sad thing is I really stunk it up then, so the fact that I am understanding now is a delight), though figuring out when to use some of these things is another challenge, LOL. If I need the covariance analysis...which I just might...I'll give it a shot. Thank you!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ksmielitz

04-03-2015 01:15 PM

Run a proc contents on your data set:

proc contents data=atc_data.fcs;

run;

Then post your full code that's generating errors - your code appears correct.

FYI: There is a free intro to SAS course and intro to SAS/STATS course from SAS institute available on SAS Analytics U home page.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

04-03-2015 01:19 PM

I will try that.

I found a possible way to do it in some archived videos my professor posted...but I anticipated different results so I am wondering if the data I am running this procedure on is the wrong type of data...I'll get that one figured out too.

Thanks for the tutorial information. I will definitely check it out!!

Kate