BookmarkSubscribeRSS Feed
mehak
Calcite | Level 5

1.if i invest $5000 each year in account .  after 15 yrs annual rate=10% and compound annual interest rate=10%.

 

2.also if a fixed term deposit of 25 yrs . Calculate total amount end of term with initial amount 1,00,000. annual interest rate 7%

.find compounded annually and monthly .

4 REPLIES 4
ballardw
Super User

Sounds like homework so I'll provide a couple hints: Functions available in data step coding: SAVING

 

Note that many of the finance functions have 3, 4 or more parameters. The answer depends on which one you leave as missing.

 

Express interest as decimals: 0.05 instead of 5%, and pay attention to compounding intervals.

mehak
Calcite | Level 5

is this the correct way to solve 1 st one

data work.invest;

do month=1 to 15;

Capital+5000;

capital+(capital*.10);

output;

end;

run;

 

2. data work.invest;

amount=500000;

rate=0.07;

do month =1 to 25 ;

earned+5000;

output;

end;

run;

title 'output dataset :Compounded monthly';

run;

proc print data=work.invest;

title 'output dataset :Compound Monthly';

run;

/* Compounded ANNUALLY */

data work.invest;

amount=500000;

rate=0.07;

do year =1 to 25;

earned+5000;

earned+(amount+earned)*rate;

output;

end;

run;

title 'output dataset :Compounded annually';

run;

proc print data=work.invest;

title 'output dataset :Compound annually';

run;

Reeza
Super User

That's your homework. What's your question for us?

Note: that it's less likely to get an answer to homework style questions without showing any effort.

 


@mehak wrote:

1.if i invest $5000 each year in account .  after 15 yrs annual rate=10% and compound annual interest rate=10%.

 

2.also if a fixed term deposit of 25 yrs . Calculate total amount end of term with initial amount 1,00,000. annual interest rate 7%

.find compounded annually and monthly .


 

 

mehak
Calcite | Level 5

is this the correct way to solve 1 st one 

data work.invest;
do month=1 to 15;
Capital+5000;
capital+(capital*.10);
output;
end;
run;

 

 

2.

data work.invest;
amount=500000;
rate=0.07;
do month =1 to 25 ;
earned+5000;

output;
end;
run;
title 'output dataset :Compounded monthly';
run;
proc print data=work.invest;
title 'output dataset :Compound Monthly';
run;


/* Compounded ANNUALLY */


data work.invest;
amount=500000;
rate=0.07;
do year =1 to 25;
earned+5000;
earned+(amount+earned)*rate;
output;
end;
run;

title 'output dataset :Compounded annually';
run;
proc print data=work.invest;
title 'output dataset :Compound annually';
run;

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
  • 4 replies
  • 442 views
  • 0 likes
  • 3 in conversation