turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- RE: Cases into Variables

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-23-2008 01:43 PM

I am a graduate student and currently I switch hit between using SPSS and SAS. OF course I prefer SAS because it is more flexible but the ability to use both programs can come in handy. Currently I am trying to find a function in SAS that SPSS has called "Cases to variables (casetovars is the syntax)". The case to variables function is exactly what it says, I can define parameters for SPSS to move cases into a new variable. Does anyone know the name of this function in SAS so I can start reading about it and learn how to use it? Or is this something that SPSS can do but SAS cannot? I find that hard to believe but anything is possible. Thank you.

---Jonathan Gallimore

Family and Consumer Studies

University of Utah

---Jonathan Gallimore

Family and Consumer Studies

University of Utah

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-24-2008 02:36 PM

Hi:

I'm not exactly sure what "casestovars" does. If you're talking about recoding or creating value labels, then you probably want PROC FORMAT.

If you're talking about "reshaping" data (for example you have 3 observations or rows each with a measurement and you want to turn the 3 obs into 1 obs with 3 variables -- MEAS1, MEAS2, MEAS3, then you're probably looking at PROC TRANSPOSE to get started. You can also rearrange data and reshape it using a DATA step program usually with ARRAYS.

Here are some (non documentation) places to read about

PROC TRANSPOSE:

http://analytics.ncsu.edu/sesug/2005/TU12_05.PDF

http://www2.sas.com/proceedings/sugi29/267-29.pdf

http://www2.sas.com/proceedings/forum2007/046-2007.pdf

http://www.valsug.org/Meetings/2004/jan/TransposeDShannon.pdf

http://www.nesug.info/Proceedings/nesug07/bb/bb01.pdf

http://www.ats.ucla.edu/stat/sas/modules/ltow_transpose.htm

PROC FORMAT:

http://www2.sas.com/proceedings/sugi31/084-31.pdf

http://www.lexjansen.com/pharmasug/2006/tutorials/tu02.pdf

http://www2.sas.com/proceedings/sugi25/25/aa/25p002.pdf

http://www.sas.cc.vt.edu/faqlib/formats.html

cynthia

I'm not exactly sure what "casestovars" does. If you're talking about recoding or creating value labels, then you probably want PROC FORMAT.

If you're talking about "reshaping" data (for example you have 3 observations or rows each with a measurement and you want to turn the 3 obs into 1 obs with 3 variables -- MEAS1, MEAS2, MEAS3, then you're probably looking at PROC TRANSPOSE to get started. You can also rearrange data and reshape it using a DATA step program usually with ARRAYS.

Here are some (non documentation) places to read about

PROC TRANSPOSE:

http://analytics.ncsu.edu/sesug/2005/TU12_05.PDF

http://www2.sas.com/proceedings/sugi29/267-29.pdf

http://www2.sas.com/proceedings/forum2007/046-2007.pdf

http://www.valsug.org/Meetings/2004/jan/TransposeDShannon.pdf

http://www.nesug.info/Proceedings/nesug07/bb/bb01.pdf

http://www.ats.ucla.edu/stat/sas/modules/ltow_transpose.htm

PROC FORMAT:

http://www2.sas.com/proceedings/sugi31/084-31.pdf

http://www.lexjansen.com/pharmasug/2006/tutorials/tu02.pdf

http://www2.sas.com/proceedings/sugi25/25/aa/25p002.pdf

http://www.sas.cc.vt.edu/faqlib/formats.html

cynthia