Date: Tue, 15 Sep 2009 22:58:14 -0400
Reply-To: Wensui Liu <liuwensui@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Wensui Liu <liuwensui@GMAIL.COM>
Subject: Re: My brain dies... How to handle the missing values genearated
by lag difference.
In-Reply-To: <3a83e80e-8847-4749-a383-5a777dee02ca@b18g2000vbl.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
just curious
are you going to use this difference on the LHS or RHS of your model?
My guess is RHS. If yes, then what are you going to model?
On Tue, Sep 15, 2009 at 3:01 PM, pigpigpig <pigzhu740@gmail.com> wrote:
> Hi all,
>
> Thanks for reading my posts first of all.
>
> I want you guys' opinion about how to handle the belowing missing
> value situation.
>
> I am trying to derive a field to capture the current insurance claim
> date and previous claim date difference.. The ultimate purpose is to
> build model.
>
> However the first claim will show missing value, because there is no
> previous claim date to subtract and get the difference. How should i
> solve the missing values generated by this situation?
>
> Should i treat the missing as 0?
> Should i just leave it as missing . , and then derive another field
> using dummy variable to indicate that it is the first claim or not..
>
>
> Example,
>
> data claims_1 (drop=cmlsdt1 cmpxdt1);
> set claims;
>
> /*1 - Claim Counter */
> by cmclmn;
> retain claim_count 0;
> if first.cmclmn then claim_count=0;
> claim_count=claim_count+1;
> diff_days=cmlsdt2-lag1(cmlsdt2);
>
> if claim_count=1 then first_claim=1; else first_claim=0;
> if claim_count=1 then diff_days=. ; else diff_days=diff_days;
>
>
> run;
>
--
==============================
WenSui Liu
Blog : statcompute.spaces.live.com
Tough Times Never Last. But Tough People Do. - Robert Schuller
==============================
|