BookmarkSubscribeRSS Feed
Aswin1099
Calcite | Level 5

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 .?

6 REPLIES 6
Kurt_Bremser
Super User

This homework assignment has been posted multiple times here. Use the search function.

When posting a question, always show the effort you have already made (code & log), and where it doesn't do what you expect.

We're not here to support lazy students, but help people who make an honest effort at solving their issue themselves.

Aswin1099
Calcite | Level 5

I have tried this but i think both of them are wrong

 

/*1. (1) DO LOOP- CONSTANT ANNUAL INTEREST RATE OF 10% */


data earning;
do year= 1 to 15;
rate=0.1;
amount+5000;
amount+(amount*0.1);
output;
end;
run;


/*1. (2) DO LOOP- COMPOUNDING ANNUAL INTEREST RATE OF 10% */

data earning2;
do year= 1 to 15;
rate=0.1;
amount+5000;
earned+(amount+earned)*rate;
output;
end;
run;

 

Aswin1099
Calcite | Level 5
DO LOOPS (1) SIMPLE INTEREST- interest will calculate every year but that interest will add in amount after 15 years
(2) COMPOUND INTEREST-every year interest will add in amount
ballardw
Super User

SAS also has a number of financial functions and/or options for the FINANCE function that allow many calculations of this specific type without any looping.

Aswin1099
Calcite | Level 5

DO LOOPS (1) SIMPLE INTEREST- interest will calculate every year but that interest will add in amount after 15 years

(2) COMPOUND INTEREST-every year interest will add in amount

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1870 views
  • 0 likes
  • 3 in conversation