BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Further to my previous question:

I have data with movement of people between states e.g.

NAME FROM TO
John Maine Maryland
Steven New York Ohio
David Ohio Chicago

I would like to produce a SAS dataset or excel table which totals the number of people who moved between each state. For example I want to be able to see how many people moved from Ohio to NY and I also need to be able to read off the number of people who moved from NY to Ohio on the same chart.

i.e. read Ohio on the x-axis and NY on the y-axis to see how many moved from Ohio to NY

and read NY on the x-axis and Ohio on the y-axis for NY to Ohio moves

Is this possible? If you use PROC FREQ is it possible to get the data into a file rather than just on the HTML output?

mu
1 REPLY 1
deleted_user
Not applicable
If you are using ODS to output then just use the phtml device and output to a file with .xls as a extension. Excel will open the file, even though it is written in html;.

ods listing close;
ods phtml file='c:\migration.xls';
proc freq data=migration;
tables to*from;
run;
ods phtml close;
ods listing;

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
  • 1 reply
  • 555 views
  • 0 likes
  • 1 in conversation