01-19-2016 04:07 PM - edited 01-19-2016 04:08 PM
Hi- I am JUST getting started in learning to use SAS OnDemand. I am trying to understand why I should use SAS data procs to create subsets of my data... as someone who already knows how to use excel, doesn't it make more sense for me to just make csv files for each and every relationship I want to test, and then make a SAS data table for each one of those? I'm not doing anything super complicated: just running two factor ANOVAs. Or am I missing something in my understanding of how to use SAS?
Thanks very much,
01-19-2016 04:25 PM
One of the very powerful tools in SAS is BY group processing; You can do the analysis for each of your subgroups with the data in one dataset. Sort the data by the grouping variable(s) and add a BY statement referencing those variables in the Anova code.
For instance suppose you are grouping data by State and County for your analyis. That would be creating one csv file for literally hundreds if not thousands of counties. In SAS: add
proc (whatever) data=dataset;
by State County;
You get separate output for each existing combination of state and county.
I learned SAS before Excel existed and always feel crippled when trying to do anything in Excel, often because of just this behavior.
01-19-2016 04:30 PM
thanks for your response!
So you feel it makes more sense to convert the giant data set (had been entered in Excel) into one giant csv, import as one giant table, and then do procs on that set from within SAS using a BY statement for each separate analysis?
01-19-2016 04:41 PM
Generally yes. If your data fits into a single Excel worksheet then it isn't considered "giant" by SAS. SAS can handle many more rows and columns than Excel.
A second thing that comes in handy are things like WHERE statements or dataset options to select records with specific characteristics.
Suppose after looking at the first analysis I realize that it included a bunch of products that weren't pertinent, or I wanted to concentrate on a selection of characterisitc. In many procedures you could add a statement like:
Where productcode in ('ProductId1' 'ProductId2' 'ProductId3') AND Sales> 5000;
To the previous code. Again generating Lots of potential output but reduced to the specified Products and where the variable Sales is larger than 5000 for each record.
01-20-2016 01:43 AM
Any data entered in Excel is at best "puny" from a SAS perspective.
Try entering 150 million rows with 2000 columns in Excel.
Subsetting/splitting data is much easier done in SAS than in Excel. And, since you have codes and logs, it is easier to document and easier to control.
Don't confuse a spreadsheet calculator with BI software.