turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-11-2013 09:44 PM

Hi how can I compute this, see attachment

S(t) X_i

.9 1

.8 2

.7 3

.6 4

.5 5

SAS code for

Sum_{i:X_i >= t*} {S(max(t*,X_i))-S(X_{i+1}}*{(X_{i+1}-max(t*,X_i)}

Accepted Solutions

Solution

07-12-2013
10:36 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to desireatem

07-12-2013 10:36 AM

BTW, should the last item in your 10:05 response be

... + (0.9-0.5)(5-1) ?

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to desireatem

07-12-2013 06:16 AM

What have you tried that is not working?

I would use the LOC function to find the i.

I would use the CHOOSE function to form max(T*, X_i)

However, there's an X_{i+1} term that is confusing me. For example, what sum do you expect when t*=5?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

07-12-2013 10:05 AM

Thanks Rick, what I wrote is confusing because I cant write math equations here. But this is what I need from above data this is the solution;

(0.9-0.8)(2-1) + (0.9-0.7)(3-1) + (0.9-0.6)(4-1) + (0.5-0.9)(5-1)

I am having issue writing the code

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to desireatem

07-12-2013 10:34 AM

What is t* for your example? Is t* = 1?

From your notation it looks like S(t) might be a survival function. Can we assume that S(t) is montonic increasing (or at least nondecreasing)?

Would the code for your 10:05 response example be helpful?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

07-12-2013 11:00 AM

Yes, it is survival, I just constructed this example in order to help build the code. It is decreasing function.

Thanks

Solution

07-12-2013
10:36 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to desireatem

07-12-2013 10:36 AM

BTW, should the last item in your 10:05 response be

... + (0.9-0.5)(5-1) ?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to desireatem

07-12-2013 10:43 AM

Is this what you want?

proc iml;

S = T(do(0.9, 0.5, -0.1));

X = T(1:5);

t = 1; /* special reference point */

dS = S

dX = X - X

sum = dS` * dX;

print sum;