06-09-2014 03:51 PM
it is a simple categorical variable, n=75, 3 classes. Results
showed Frequency missing =10.
|The FREQ Procedure|
Missing = 10
06-09-2014 04:04 PM
Can you show the code?
If you imported this from an Excel file, you may have accidentally imported some empty rows.
Run a proc contents on the dataset to see what shows up.
proc contents data=have;
06-09-2014 04:12 PM
It is an excel file. Here is the code to access data sheet:
06-09-2014 05:13 PM
Try this and you will get the correct numbers. In excel file you deleted some of the data points (10) and these were imported as part of sas dataset.
proc freq data=have (where=(flowblr1 ne ' '));
06-10-2014 01:52 PM
Thanks for the input Reeza. That is true, data should be cleaned before processing. Could you please recommend some solution to exclude missing values while importing excel data into SAS or through some other method?
06-10-2014 02:08 PM
Clean it up manually. The problem with the method below is that you may have valid missing obs, so you need to understand the data.
if missing(flowblr1) then delete;
06-10-2014 02:23 PM
Thanks Reeza - This works if we understand our data. But when we load data from other applications we are not sure about data structures and we may get missing values at the end of variable(s) which are hard to identify. So processing data after loading into SAS will make the life easier.
06-12-2014 01:47 PM
I know one way that I have found that works is to use excel libname engine (if you have it available). I can run the libname, see how sas is seeing the excel file, then use a data step to bring the file into sas with any cleaning done in the data step. In instances where missing is valid in all fields, I have wrote an array to check across all fields before deleting -- obviously a much bigger pain the larger the dataset.
libname in excel "\excelfile.xlsx";
drop f_20 - f_25; *blank column / field clean up;
if id = '' then delete; *row clean up -- works as long as id always suppose to have a value;
libname in clear;
Just an added opinion!