BookmarkSubscribeRSS Feed
clcl
Calcite | Level 5

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

9 REPLIES 9
Reeza
Super User

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;

clcl
Calcite | Level 5

yeh i tried that ... still does not work .... any other ideas ?

could it be something to do with,   ods graphics on;  ?

Doc_Duke
Rhodochrosite | Level 12

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

clcl
Calcite | Level 5

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;

Keith
Obsidian | Level 7

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.

clcl
Calcite | Level 5

yes i am also running 9.1.3 , so there is no way to make the plot ??? in our version ?

Keith
Obsidian | Level 7

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.

clcl
Calcite | Level 5

thanks !!!

Reeza
Super User

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 3127 views
  • 0 likes
  • 4 in conversation