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
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;
Reeza,
Thank you for responding!
I get into SAS now and give it a shot!
Kate
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
I think Both of your method are right . If there are some other variables ,I would consider Covariance Analysis by proc glm .
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!
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.
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.