Hi hope some one can help me , i need to make a HISTOGRAM plot via ttest .
cant seem to make it work can anyone help ???
ods graphics on;
ods rtf;
data q4;
infile 'kredit.txt';
input tz 1-9 kredit 11 hight 13-15 .1;
proc ttest plots = all;
class kredit;
var hight;
run;
ods rtf close;
317 proc ttest plots = all;
----- -
22 200
ERROR 22-322: Syntax error, expecting one of the following: ;, ALPHA, CI, COCHRAN, DATA, H0.
ERROR 200-322: The symbol is not recognized and will be ignored.
318
319 class kredit;
ERROR: File WORK.ALL.DATA does not exist
Break up the code and check each section.
did the file import correctly? Check your input statement, there's a .1 there that seems random
data q4;
infile 'kredit.txt';
input tz 1-9 kredit 11 hight 13-15 .1;
Try specifying the dataset directly,
proc ttest data=q4 plots=all;
class kredit;
var hight;
run;
yeh i tried that ... still does not work .... any other ideas ?
could it be something to do with, ods graphics on; ?
clcl,
It would help to see more.
Start with a new SAS session (your log showed line 317, so the underlying problem could have been earlier), run just that code and post the ENTIRE log.
Doc Muhlbaier
Duke
see below code and log , thanks !!!
ods graphics on;
ods rtf;
data q4;
infile 'C:\Documents and Settings\Larah\My Documents\Google Drive\Test 6\kredit.txt';
input tz 1-9 kredit 11 hight 13-15 .1;
proc ttest data=q4 plots=all;
class kredit;
var hight;
run;
---------------------------------------------------------------------------------------------------------------------
18
19
20 ods graphics on;
NOTE: ODS Statistical Graphics will require a SAS/GRAPH license when it is declared production.
21 ods rtf;
NOTE: Writing RTF Body file: sasrtf.rtf
22
23 data q4;
24
25 infile 'C:\Documents and Settings\Larah\My Documents\Google Drive\Test 6\kredit.txt';
26 input tz 1-9 kredit 11 hight 13-15 .1;
27
28
NOTE: The infile 'C:\Documents and Settings\Larah\My Documents\Google Drive\Test 6\kredit.txt'
is:
File Name=C:\Documents and Settings\Larah\My Documents\Google Drive\Test 6\kredit.txt,
RECFM=V,LRECL=256
NOTE: 99 records were read from the infile 'C:\Documents and Settings\Larah\My Documents\Google
Drive\Test 6\kredit.txt'.
The minimum record length was 37.
The maximum record length was 37.
NOTE: The data set WORK.Q4 has 99 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.19 seconds
cpu time 0.03 seconds
29 proc ttest data=q4 plots=all;
------
22 200
ERROR 22-322: Syntax error, expecting one of the following: ;, (, ALPHA, CI, COCHRAN, DATA, H0.
ERROR 200-322: The symbol is not recognized and will be ignored.
30 class kredit;
WARNING: Ignoring second data set reference.
31 var hight;
32 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE TTEST used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds
33
34
35
36 ods rtf close;
ods rtf close;
What version of SAS are you using, because the PLOTS statement for PROC TTEST only became available in 9.2. I have 9.1.3 and am getting the same error message as you, so I suspect that is the cause.
yes i am also running 9.1.3 , so there is no way to make the plot ??? in our version ?
Not in TTEST. I tend to use PROC UNIVARIATE to create histograms, so I guess you can create an output dataset in TTEST and then use UNIVARIATE to produce the histogram.
thanks !!!
I don't think you need to output from proc TTest
Something like the following should give you similar results, but I have 9.3 so I might be wrong.
ods graphics on;
proc univariate data=sashelp.class noprint;
class sex;
histogram weight;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.