BookmarkSubscribeRSS Feed
trb
Calcite | Level 5 trb
Calcite | Level 5
I am a student and new to SAS. I have a pretty large dataset in Excel and I am trying to duplicate some analyses my advisor ran after typing her dataset right into excel.

This is how I imported my data from Excel:
PROC IMPORT OUT= WORK.dissertation
DATAFILE = "C:\Documents and Settings\Me\My Documents\dissertation.xls"
DBMS=EXCEL REPLACE; stopover;
SHEET="Sheet1;
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;


This is her data statements that she ran before doing ANOVAS:
DATA rate0 ;
INFILE 'H:\Data\ms-ratings-dats.TXT'' ;
INPUT var1 1-3 var2 5 var3 7-8 var4 10-12 var5 14 var6 16 var7 18 var8 20;


From there, it looks like she sets the value of some of the variables and then runs the ANOVA.

Is there a comparable INFILE statement I should be running with my Excel data that would make my data ready for analysis?



eta: when I just replace the TXT file name with my excel file, I get errors; it reads none of the variables. Message was edited by: trb
4 REPLIES 4
Reeza
Super User
That infile statement is reading a data set from a text file.

If you're trying to use the data you imported instead of the text file, use the line
set dissertation;

instead of the infile and input lines. You'll probably have to rename variables as well.

I'll also mention I haven't seen a stopover option before in proc import...I'll have to google that one.

You might want to review some sas basics before playing around with this stuff though. I highly recommend the SAS UCLA tutorials online for beginners.
trb
Calcite | Level 5 trb
Calcite | Level 5
Thank you! I was able to run my ANOVAS with your help. And thanks for referring me to the user-friendly tutorials!
trb
Calcite | Level 5 trb
Calcite | Level 5
Thank you! I was able to run my ANOVAS with your help. And thanks for referring me to the user-friendly tutorials!
piggy
Fluorite | Level 6
you can save your Excel file in csv format, then use the INFILE.

sas-innovate-2024.png

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.

 

Register now!

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.

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
  • 4 replies
  • 786 views
  • 0 likes
  • 3 in conversation