10-22-2013 03:25 PM
I'm trying to organize my dataset with multiple variables in a table with descriptive statistics. Some of them are responses to demographic questions, some responses to survey questions, and then there are many additional variables that I do not need to analyze. How do I arrange these in a table so that I see only the variables I want to see and not the ones I don't? (ie drop the ones I don't need or select the ones I do need?) I know I use the:
procedure-- just not exactly sure how to go from there. Appreciate any help!
10-22-2013 07:37 PM
export the variables to Excel and then sort it in the way you like to see in the final output . Delete the variables you don't like to keep. Then run the following code
%let keep_var= <copy and paste the sorted variable names from Excel here or just type in the variable names you like to keep>;
10-23-2013 10:51 AM
Hi Reeza and Mit-- Perhaps my question was misleading-- I'm basically trying to see my data in a table- that summarizes the frequencies and descriptive statistics for only select variables I'm analyzing (some dichotomous, some contininous, and most categorical)- I thought I used:
table (var1) (var2) (var3) (etc..)
Just wondering if there is a better way to do this? So that it will summarize output I want, organized in a way that makes sense for what I'm trying to do (which is describe my population so that I can then look at whether or not those charateristics predict certain outcomes..)
Thanks a lot!
10-23-2013 10:55 AM
Not really. Generally I'll just run a whole bunch of procs (freq/means) on my variables to first get an idea.
Once I'm more familiar with my data then I follow the standards in this paper for preparing results, primarily for publication. SAS doesn't do this by default, so it takes a bit of manipulation by the coder/user to generate such tables.
10-23-2013 12:05 PM
Thanks Reeza. Yeah I'm pretty skilled/educated on analyzing the output-- it's just getting my data to give me that output (ie knowing the SAS language since I was required to use STATA in school )
Do you just dump all variables in following the table statement? Is it ok to place variables of mixed types (cont/cat/dichot) following the table statement? Also-- do you know a command for merging 2 data sets together so that I can look at everything in one big table?
10-23-2013 12:09 PM
Check out the UCLA tutorials:
It's fine to dump all the categorical data into a proc freq but useless for continuous variables.
For continuous variables use proc univariate instead.