BookmarkSubscribeRSS Feed
iressa131
Calcite | Level 5

Hello I want to read in a small dataset and just want to make sure my format is correct. I have 4 groups and 5 observations per group. 

I have a feeling  its wrong because when i run a chi square test i'm getting " . " as some of the calculated values

 

DATA q3; 
INPUT drug $ response ;
CARDS ;
a 42 17 24 39 43 
b 28 50 44 32 61
c 57 45 48 41 54
d 29 40 22 34 30
;
run;
1 REPLY 1
Reeza
Super User

Your input statement should have enough variables to match your data but you only list two. Do you want the data to look as shown or do you want it reformatted to a long format like:

 

a 42

a 17

a 24

 

 

If you want the wide format, add the rest of the variables to your list, reponse1-response5. 

If you want the long format you need to use a trailing @@ to hold the line when reading the data.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 618 views
  • 0 likes
  • 2 in conversation