SAS Homework 2 Q1. The data file Grades contains the information about students’ exam scores. If the student’s score is lower than 60, the grade is F. If the score is higher than or equal to 60...


SAS Homework 2





Q1. The data file Grades contains the information about students’ exam scores. If the student’s score is lower than 60, the grade is F. If the score is higher than or equal to 60 but lower than 70, the grade is D. If the score is higher than or equal to 70 but lower than 80, the grade is C. If the score is higher than or equal to 80 but lower than 90, the grade is B. If the score is higher than or equal to 90, the grade is A.




Please read the data file Grades into your SAS, and create a new variable called Grade. Paste your SAS code below and screen shoot the data set in your SAS.








































Q2. Read the data file Grades, and create a dummy variable called Gender_dummy. Use 0 to represent females, and use 1 to represent males. Create another character variable, called Note. If the gender is female, write “This student is a girl” in the note variable. If the gender is male, write “This student is a boy” in the note variable. Paste your SAS code below and screen shoot the data set in your SAS. (Please exclude the variable Grade from the previous question)




Q3. Assume the annual interest rate is 3.65%, and you save $3500 at the end of year 2000. Assume there are 365 days in every year. What is the total saving at the end of year 2006 if interest compounds daily? Use nesting DO loops to do the calculation, paste your SAS code, and screen shoot the last observation of your SAS data set, which is also your answer of the question.












































Q4. Assume the annual interest rate is 3.65%, and you save $3500 at the end of year 2000. Assume there are 365 days in every year. How many days will it take for your total saving to increase to $4000 if interest compounds daily? Use nesting DO loops to do the calculation, paste your SAS code, and screen shoot the last observation of your SAS data set, which is also your answer of the question.




































Q5. Without running the following program, how many times does this DO loop execute?





DATA
Store;


Revenue=1000;


Year=2000;




DO count =
1
TO
11;


Revenue=2*Revenue+500;


Year=Year+1;




OUTPUT;


END;



Run;




9




10




11




12












Q6. Without running the following program, how many observations and variables does this Store data set contain?





DATA
Store (Drop=count);


Revenue=1000;




Year=2000;




DO count =
1
TO
10
BY
3;


Revenue=2*Revenue+500;


Year=Year+1;


END;



Run;








1 observation and 2 variables




1 observations and 3 variables




3 observations and 3 variables




4 observations and 2 variables





May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here