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;
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.