[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Method to identify missing value
From:       Melodyp <pearsonmelody () GMAIL ! COM>
Date:       2009-03-31 13:27:21
Message-ID: 7306f115-0219-4b1d-8956-13053a39347a () n20g2000vba ! googlegroups ! com
[Download RAW message or body]

On Mar 30, 3:57 pm, ms...@albany.edu (Mike Zdeb) wrote:
> hi ... for some details of the discussion referred to by Joe, you could also take a look at
>
> http://www.sascommunity.org/wiki/Shed_observations_with_all_variables...
>
> --
> Mike Zdeb
> U@Albany School of Public Health
> One University Place
> Rensselaer, New York 12144-3456
> P/518-402-6479 F/630-604-1475
>
>
>
> > Melody, if you search the list archives I think this question was answered a
> > few months ago.  I think there are a lot of solutions, two of them were:
>
> > data have;
> > infile datalines missover;
> > input x y z a $ b $ c $ ;
> > datalines;
> > 7 8 9 a s d
>
> > 1 2 3
> > . . . a s d
> > ;;;;
> > run;
>
> > data want_n;
> > set have;
> > if missing(sum(of _numeric_)) then delete;
> > run;
>
> > data want_c;
> > set have;
> > if missing(cats(of _character_)) then delete;
> > run;
>
> > Both want_c and want_n will have 2 records (the two with the appropriate
> > data type non-missing in them).
>
> > If you want to delete only rows that have missings for every char AND
> > numeric, just and the conditions together:
>
> > data want_cn;
> > set have;
> > if missing(cats(of _character_)) and missing(sum(of _numeric_)) then delete;
> > run;
>
> > You can't use _character_ or _numeric_ (or any other automatic list) as a
> > single variable, like you did below; you have to combine them together
> > somehow.  CATS and SUM both combine their respective types of variables
> > together, disregarding any missings, so if all are missings, they both
> > return missing as a result.  The keyword 'of' tells SAS to use the list as a
> > variable list, and not a single variable.
>
> > -Joe
>
> > On Mon, Mar 30, 2009 at 2:33 PM, Melody Pearson <pearsonmel...@gmail.com>wrote:
>
> >> Joe,
>
> >> All I need to just delete the rows, see the charct will be " " but the
> >> Numberica will be ".", I just need to remove them from my data will be fine.
>
> >> I used the following two way, none of them works:
>
> >> *
>
> >> data
> >> * melody.carrier_test_sep_nomiss;
>
> >> set
> >> melody.carrier_test_sep;
>
> >> where
> >> _n_<>" " or".";
>
> >> if
> >> _character_ =" " then delete;
>
> >> if
> >> _numeric_ ="." then delete;
> >> *Thank you Joe for your help.*
>
> >> **
> >> Regards,
>
> >> Melody
>
> >> On Sun, Mar 22, 2009 at 10:48 AM, Joe Matise <snoopy...@gmail.com> wrote:
>
> >>> Melody, you need to be a lot more specific than that.  Identifying a
> >>> missing value and deleting the row is as simple as
>
> >>> data want;
> >>> set have;
> >>> if missing(x) then delete;
> >>> run;
>
> >>> and assigning a non-missing value simply requires determining that value
> >>> (somehow) and replacing 'delete' with an assignment statement appropriate to
> >>> your value.
>
> >>> However, imputing a value depends on what you're imputing from, and other
> >>> specifics of your data.  You'll get a better answer if you provide sample
> >>> data and a description of your needs.
>
> >>> -Joe
>
> >>> On Sun, Mar 22, 2009 at 7:41 AM, Melodyp <pearsonmel...@gmail.com> wrote:
>
> >>>> Does anybody have any idea how to identify missing value and
> >>>> automatically to either delete or impute to a value desired?
>
> >>>> thank you,- Hide quoted text -
>
> - Show quoted text -

Thank you for your help, I will let you know how it goes.
Melody
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic