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

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Financial Calculations - Future Value based on Con...

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

06-22-2016 01:21 AM - last edited on 06-22-2016 05:56 PM by Reeza

HI,

on January 1 of each year,$5000 is invested in an amount .complete the data step with do loop to determine the value of the account after 15 years 1) if a constant annual invest rate of 10% is expected .2)if a compounding annual interest rate of 10 % is expected .?

wht should be the code ??

please help ?

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

Posted in reply to Prateek1

06-21-2016 07:10 AM - last edited on 06-21-2016 07:55 AM by Reeza

HI,

on January 1 of each year,$5000 is invested in an amount .complete the data step with do loop to determine the value of the account after 15 years 1) if a constant annual invest rate of 10% is expected .2)if a compounding annual interest rate of 10 % is expected .?

wht should be the code ??

please help ?

this is my code :

```
DATA WORK.INVEST1;
DO COUNT=1 TO 15;
CAPITAL +5000;
CAPITAL+(CAPITAL*.10);
output;
END;
RUN;
```

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

Posted in reply to Prateek1

06-21-2016 07:58 AM

That looks pretty close. I'm not sure what the first requirement means though? Does that mean you invest an additional 10% each, on top of the 5000/year?

1) if a constant annual invest rate of 10% is expected

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

Posted in reply to Reeza

06-21-2016 08:52 AM

hi,

what should be the code for partone and part second ??

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

Posted in reply to Prateek1

06-21-2016 09:14 AM

You have the second requirement.

I dont understand the first requirement. If you clarify it, perhaps someone can help.

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

Posted in reply to Reeza

06-22-2016 01:46 AM

Reeza wrote:

That looks pretty close. I'm not sure what the first requirement means though? Does that mean you invest an additional 10% each, on top of the 5000/year?

1) if a constant annual invest rate of 10% is expected

Can you please answer the question above. Reposting without clarifying doesn't really add anything.

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

Posted in reply to Prateek1

06-21-2016 11:01 PM

if it is continuous compounding, formula should look like this ?

5000*e^0.1*15 +

5000*e^0.1*14 +

.......

5000*e^0.1*1

```
data _null_;
do year=1 to 15;
CAPITAL+5000*constant('e')**(0.1*year);
put year= CAPITAL=;
end;
run;
```

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

Posted in reply to Ksharp

06-22-2016 12:21 AM

No, because doing *1.1 each year will account for the compounding.

But this is an exercise for any actual calculation there are SAS functions that will handle this.

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

Posted in reply to Prateek1

06-22-2016 03:13 AM

HI,

on January 1 of each year,$5000 is invested in an amount .complete the data step with do loop to determine the value of the account after 15 years 1) if a constant annual invest rate of 10% is expected .2)if a compounding annual interest rate of 10 % is expected .?

wht should be the code ??

please help ?

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

Posted in reply to Prateek1

06-22-2016 04:16 AM

For Q1 is it invest rate or interest rate?

Your initial answer was correct for Q2.

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

Posted in reply to Reeza

06-22-2016 05:53 AM

HI,

For q1, it is interest rate.

what should be the code ?

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

Posted in reply to Reeza

06-22-2016 06:01 AM

hi,

for Q1) if a constant annual interest rate of 10% is expected.?

what should be the code ?

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

Posted in reply to Prateek1

06-22-2016 05:55 PM

@Ksharp code was correct then - it uses a continuous interest rate formula that you can find via google.

http://www.mathwarehouse.com/compound-interest/continuously-compounded-interest.php

This answer may not be correct, it depends partly on when you account for the 5000, beginning or end of year. This assumes beginning of the year.

Good Luck.

```
data want;
capital1=0;capital2=0;
do year=1 to 15;
capital1 = (capital1+5000)*constant('e')**0.1;
capital2 = (capital2+5000)*1.1;
output;
end;
run;
proc print data=want;
run;
```